home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Python 1.4 / Python 1.4 source / Mac / Modules / qt / Qtmodule.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-31  |  160.3 KB  |  6,008 lines  |  [TEXT/CWIE]

  1.  
  2. /* =========================== Module Qt ============================ */
  3.  
  4. #include "Python.h"
  5.  
  6.  
  7.  
  8. #define SystemSevenOrLater 1
  9.  
  10. #include "macglue.h"
  11. #include <Memory.h>
  12. #include <Dialogs.h>
  13. #include <Menus.h>
  14. #include <Controls.h>
  15.  
  16. extern PyObject *ResObj_New(Handle);
  17. extern int ResObj_Convert(PyObject *, Handle *);
  18. extern PyObject *OptResObj_New(Handle);
  19. extern int OptResObj_Convert(PyObject *, Handle *);
  20.  
  21. extern PyObject *WinObj_New(WindowPtr);
  22. extern int WinObj_Convert(PyObject *, WindowPtr *);
  23. extern PyTypeObject Window_Type;
  24. #define WinObj_Check(x) ((x)->ob_type == &Window_Type)
  25.  
  26. extern PyObject *DlgObj_New(DialogPtr);
  27. extern int DlgObj_Convert(PyObject *, DialogPtr *);
  28. extern PyTypeObject Dialog_Type;
  29. #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type)
  30.  
  31. extern PyObject *MenuObj_New(MenuHandle);
  32. extern int MenuObj_Convert(PyObject *, MenuHandle *);
  33.  
  34. extern PyObject *CtlObj_New(ControlHandle);
  35. extern int CtlObj_Convert(PyObject *, ControlHandle *);
  36.  
  37. extern PyObject *GrafObj_New(GrafPtr);
  38. extern int GrafObj_Convert(PyObject *, GrafPtr *);
  39.  
  40. extern PyObject *BMObj_New(BitMapPtr);
  41. extern int BMObj_Convert(PyObject *, BitMapPtr *);
  42.  
  43. extern PyObject *WinObj_WhichWindow(WindowPtr);
  44.  
  45. #include <Movies.h>
  46.  
  47. /* Exported by Cmmodule.c: */
  48. extern PyObject *CmpObj_New(Component);
  49. extern int CmpObj_Convert(PyObject *, Component *);
  50. extern PyObject *CmpInstObj_New(ComponentInstance);
  51. extern int CmpInstObj_Convert(PyObject *, ComponentInstance *);
  52.  
  53. /* Exported by Qdmodule.c: */
  54. extern PyObject *QdRGB_New(RGBColor *);
  55. extern int QdRGB_Convert(PyObject *, RGBColor *);
  56.  
  57. /* Our own, used before defined: */
  58. staticforward PyObject *TrackObj_New(Track);
  59. staticforward int TrackObj_Convert(PyObject *, Track *);
  60. staticforward PyObject *MovieObj_New(Movie);
  61. staticforward int MovieObj_Convert(PyObject *, Movie *);
  62. staticforward PyObject *MovieCtlObj_New(MovieController);
  63. staticforward int MovieCtlObj_Convert(PyObject *, MovieController *);
  64.  
  65.  
  66.  
  67. static PyObject *Qt_Error;
  68.  
  69. /* ------------------ Object type MovieController ------------------- */
  70.  
  71. PyTypeObject MovieController_Type;
  72.  
  73. #define MovieCtlObj_Check(x) ((x)->ob_type == &MovieController_Type)
  74.  
  75. typedef struct MovieControllerObject {
  76.     PyObject_HEAD
  77.     MovieController ob_itself;
  78. } MovieControllerObject;
  79.  
  80. PyObject *MovieCtlObj_New(itself)
  81.     MovieController itself;
  82. {
  83.     MovieControllerObject *it;
  84.     if (itself == NULL) {
  85.                         PyErr_SetString(Qt_Error,"Cannot create null MovieController");
  86.                         return NULL;
  87.                     }
  88.     it = PyObject_NEW(MovieControllerObject, &MovieController_Type);
  89.     if (it == NULL) return NULL;
  90.     it->ob_itself = itself;
  91.     return (PyObject *)it;
  92. }
  93. MovieCtlObj_Convert(v, p_itself)
  94.     PyObject *v;
  95.     MovieController *p_itself;
  96. {
  97.     if (!MovieCtlObj_Check(v))
  98.     {
  99.         PyErr_SetString(PyExc_TypeError, "MovieController required");
  100.         return 0;
  101.     }
  102.     *p_itself = ((MovieControllerObject *)v)->ob_itself;
  103.     return 1;
  104. }
  105.  
  106. static void MovieCtlObj_dealloc(self)
  107.     MovieControllerObject *self;
  108. {
  109.     DisposeMovieController(self->ob_itself);
  110.     PyMem_DEL(self);
  111. }
  112.  
  113. static PyObject *MovieCtlObj_MCSetMovie(_self, _args)
  114.     MovieControllerObject *_self;
  115.     PyObject *_args;
  116. {
  117.     PyObject *_res = NULL;
  118.     ComponentResult _rv;
  119.     Movie theMovie;
  120.     WindowPtr movieWindow;
  121.     Point where;
  122.     if (!PyArg_ParseTuple(_args, "O&O&O&",
  123.                           MovieObj_Convert, &theMovie,
  124.                           WinObj_Convert, &movieWindow,
  125.                           PyMac_GetPoint, &where))
  126.         return NULL;
  127.     _rv = MCSetMovie(_self->ob_itself,
  128.                      theMovie,
  129.                      movieWindow,
  130.                      where);
  131.     _res = Py_BuildValue("l",
  132.                          _rv);
  133.     return _res;
  134. }
  135.  
  136. static PyObject *MovieCtlObj_MCGetIndMovie(_self, _args)
  137.     MovieControllerObject *_self;
  138.     PyObject *_args;
  139. {
  140.     PyObject *_res = NULL;
  141.     Movie _rv;
  142.     short index;
  143.     if (!PyArg_ParseTuple(_args, "h",
  144.                           &index))
  145.         return NULL;
  146.     _rv = MCGetIndMovie(_self->ob_itself,
  147.                         index);
  148.     _res = Py_BuildValue("O&",
  149.                          MovieObj_New, _rv);
  150.     return _res;
  151. }
  152.  
  153. static PyObject *MovieCtlObj_MCRemoveMovie(_self, _args)
  154.     MovieControllerObject *_self;
  155.     PyObject *_args;
  156. {
  157.     PyObject *_res = NULL;
  158.     ComponentResult _rv;
  159.     if (!PyArg_ParseTuple(_args, ""))
  160.         return NULL;
  161.     _rv = MCRemoveMovie(_self->ob_itself);
  162.     _res = Py_BuildValue("l",
  163.                          _rv);
  164.     return _res;
  165. }
  166.  
  167. static PyObject *MovieCtlObj_MCIsPlayerEvent(_self, _args)
  168.     MovieControllerObject *_self;
  169.     PyObject *_args;
  170. {
  171.     PyObject *_res = NULL;
  172.     ComponentResult _rv;
  173.     EventRecord e;
  174.     if (!PyArg_ParseTuple(_args, "O&",
  175.                           PyMac_GetEventRecord, &e))
  176.         return NULL;
  177.     _rv = MCIsPlayerEvent(_self->ob_itself,
  178.                           &e);
  179.     _res = Py_BuildValue("l",
  180.                          _rv);
  181.     return _res;
  182. }
  183.  
  184. static PyObject *MovieCtlObj_MCDoAction(_self, _args)
  185.     MovieControllerObject *_self;
  186.     PyObject *_args;
  187. {
  188.     PyObject *_res = NULL;
  189.     ComponentResult _rv;
  190.     short action;
  191.     void * params;
  192.     if (!PyArg_ParseTuple(_args, "hs",
  193.                           &action,
  194.                           ¶ms))
  195.         return NULL;
  196.     _rv = MCDoAction(_self->ob_itself,
  197.                      action,
  198.                      params);
  199.     _res = Py_BuildValue("l",
  200.                          _rv);
  201.     return _res;
  202. }
  203.  
  204. static PyObject *MovieCtlObj_MCSetControllerAttached(_self, _args)
  205.     MovieControllerObject *_self;
  206.     PyObject *_args;
  207. {
  208.     PyObject *_res = NULL;
  209.     ComponentResult _rv;
  210.     Boolean attach;
  211.     if (!PyArg_ParseTuple(_args, "b",
  212.                           &attach))
  213.         return NULL;
  214.     _rv = MCSetControllerAttached(_self->ob_itself,
  215.                                   attach);
  216.     _res = Py_BuildValue("l",
  217.                          _rv);
  218.     return _res;
  219. }
  220.  
  221. static PyObject *MovieCtlObj_MCIsControllerAttached(_self, _args)
  222.     MovieControllerObject *_self;
  223.     PyObject *_args;
  224. {
  225.     PyObject *_res = NULL;
  226.     ComponentResult _rv;
  227.     if (!PyArg_ParseTuple(_args, ""))
  228.         return NULL;
  229.     _rv = MCIsControllerAttached(_self->ob_itself);
  230.     _res = Py_BuildValue("l",
  231.                          _rv);
  232.     return _res;
  233. }
  234.  
  235. static PyObject *MovieCtlObj_MCSetVisible(_self, _args)
  236.     MovieControllerObject *_self;
  237.     PyObject *_args;
  238. {
  239.     PyObject *_res = NULL;
  240.     ComponentResult _rv;
  241.     Boolean visible;
  242.     if (!PyArg_ParseTuple(_args, "b",
  243.                           &visible))
  244.         return NULL;
  245.     _rv = MCSetVisible(_self->ob_itself,
  246.                        visible);
  247.     _res = Py_BuildValue("l",
  248.                          _rv);
  249.     return _res;
  250. }
  251.  
  252. static PyObject *MovieCtlObj_MCGetVisible(_self, _args)
  253.     MovieControllerObject *_self;
  254.     PyObject *_args;
  255. {
  256.     PyObject *_res = NULL;
  257.     ComponentResult _rv;
  258.     if (!PyArg_ParseTuple(_args, ""))
  259.         return NULL;
  260.     _rv = MCGetVisible(_self->ob_itself);
  261.     _res = Py_BuildValue("l",
  262.                          _rv);
  263.     return _res;
  264. }
  265.  
  266. static PyObject *MovieCtlObj_MCGetControllerBoundsRect(_self, _args)
  267.     MovieControllerObject *_self;
  268.     PyObject *_args;
  269. {
  270.     PyObject *_res = NULL;
  271.     ComponentResult _rv;
  272.     Rect bounds;
  273.     if (!PyArg_ParseTuple(_args, ""))
  274.         return NULL;
  275.     _rv = MCGetControllerBoundsRect(_self->ob_itself,
  276.                                     &bounds);
  277.     _res = Py_BuildValue("lO&",
  278.                          _rv,
  279.                          PyMac_BuildRect, &bounds);
  280.     return _res;
  281. }
  282.  
  283. static PyObject *MovieCtlObj_MCSetControllerBoundsRect(_self, _args)
  284.     MovieControllerObject *_self;
  285.     PyObject *_args;
  286. {
  287.     PyObject *_res = NULL;
  288.     ComponentResult _rv;
  289.     Rect bounds;
  290.     if (!PyArg_ParseTuple(_args, "O&",
  291.                           PyMac_GetRect, &bounds))
  292.         return NULL;
  293.     _rv = MCSetControllerBoundsRect(_self->ob_itself,
  294.                                     &bounds);
  295.     _res = Py_BuildValue("l",
  296.                          _rv);
  297.     return _res;
  298. }
  299.  
  300. static PyObject *MovieCtlObj_MCGetControllerBoundsRgn(_self, _args)
  301.     MovieControllerObject *_self;
  302.     PyObject *_args;
  303. {
  304.     PyObject *_res = NULL;
  305.     RgnHandle _rv;
  306.     if (!PyArg_ParseTuple(_args, ""))
  307.         return NULL;
  308.     _rv = MCGetControllerBoundsRgn(_self->ob_itself);
  309.     _res = Py_BuildValue("O&",
  310.                          ResObj_New, _rv);
  311.     return _res;
  312. }
  313.  
  314. static PyObject *MovieCtlObj_MCGetWindowRgn(_self, _args)
  315.     MovieControllerObject *_self;
  316.     PyObject *_args;
  317. {
  318.     PyObject *_res = NULL;
  319.     RgnHandle _rv;
  320.     WindowPtr w;
  321.     if (!PyArg_ParseTuple(_args, "O&",
  322.                           WinObj_Convert, &w))
  323.         return NULL;
  324.     _rv = MCGetWindowRgn(_self->ob_itself,
  325.                          w);
  326.     _res = Py_BuildValue("O&",
  327.                          ResObj_New, _rv);
  328.     return _res;
  329. }
  330.  
  331. static PyObject *MovieCtlObj_MCMovieChanged(_self, _args)
  332.     MovieControllerObject *_self;
  333.     PyObject *_args;
  334. {
  335.     PyObject *_res = NULL;
  336.     ComponentResult _rv;
  337.     Movie m;
  338.     if (!PyArg_ParseTuple(_args, "O&",
  339.                           MovieObj_Convert, &m))
  340.         return NULL;
  341.     _rv = MCMovieChanged(_self->ob_itself,
  342.                          m);
  343.     _res = Py_BuildValue("l",
  344.                          _rv);
  345.     return _res;
  346. }
  347.  
  348. static PyObject *MovieCtlObj_MCSetDuration(_self, _args)
  349.     MovieControllerObject *_self;
  350.     PyObject *_args;
  351. {
  352.     PyObject *_res = NULL;
  353.     ComponentResult _rv;
  354.     TimeValue duration;
  355.     if (!PyArg_ParseTuple(_args, "l",
  356.                           &duration))
  357.         return NULL;
  358.     _rv = MCSetDuration(_self->ob_itself,
  359.                         duration);
  360.     _res = Py_BuildValue("l",
  361.                          _rv);
  362.     return _res;
  363. }
  364.  
  365. static PyObject *MovieCtlObj_MCGetCurrentTime(_self, _args)
  366.     MovieControllerObject *_self;
  367.     PyObject *_args;
  368. {
  369.     PyObject *_res = NULL;
  370.     TimeValue _rv;
  371.     TimeScale scale;
  372.     if (!PyArg_ParseTuple(_args, ""))
  373.         return NULL;
  374.     _rv = MCGetCurrentTime(_self->ob_itself,
  375.                            &scale);
  376.     _res = Py_BuildValue("ll",
  377.                          _rv,
  378.                          scale);
  379.     return _res;
  380. }
  381.  
  382. static PyObject *MovieCtlObj_MCNewAttachedController(_self, _args)
  383.     MovieControllerObject *_self;
  384.     PyObject *_args;
  385. {
  386.     PyObject *_res = NULL;
  387.     ComponentResult _rv;
  388.     Movie theMovie;
  389.     WindowPtr w;
  390.     Point where;
  391.     if (!PyArg_ParseTuple(_args, "O&O&O&",
  392.                           MovieObj_Convert, &theMovie,
  393.                           WinObj_Convert, &w,
  394.                           PyMac_GetPoint, &where))
  395.         return NULL;
  396.     _rv = MCNewAttachedController(_self->ob_itself,
  397.                                   theMovie,
  398.                                   w,
  399.                                   where);
  400.     _res = Py_BuildValue("l",
  401.                          _rv);
  402.     return _res;
  403. }
  404.  
  405. static PyObject *MovieCtlObj_MCDraw(_self, _args)
  406.     MovieControllerObject *_self;
  407.     PyObject *_args;
  408. {
  409.     PyObject *_res = NULL;
  410.     ComponentResult _rv;
  411.     WindowPtr w;
  412.     if (!PyArg_ParseTuple(_args, "O&",
  413.                           WinObj_Convert, &w))
  414.         return NULL;
  415.     _rv = MCDraw(_self->ob_itself,
  416.                  w);
  417.     _res = Py_BuildValue("l",
  418.                          _rv);
  419.     return _res;
  420. }
  421.  
  422. static PyObject *MovieCtlObj_MCActivate(_self, _args)
  423.     MovieControllerObject *_self;
  424.     PyObject *_args;
  425. {
  426.     PyObject *_res = NULL;
  427.     ComponentResult _rv;
  428.     WindowPtr w;
  429.     Boolean activate;
  430.     if (!PyArg_ParseTuple(_args, "O&b",
  431.                           WinObj_Convert, &w,
  432.                           &activate))
  433.         return NULL;
  434.     _rv = MCActivate(_self->ob_itself,
  435.                      w,
  436.                      activate);
  437.     _res = Py_BuildValue("l",
  438.                          _rv);
  439.     return _res;
  440. }
  441.  
  442. static PyObject *MovieCtlObj_MCIdle(_self, _args)
  443.     MovieControllerObject *_self;
  444.     PyObject *_args;
  445. {
  446.     PyObject *_res = NULL;
  447.     ComponentResult _rv;
  448.     if (!PyArg_ParseTuple(_args, ""))
  449.         return NULL;
  450.     _rv = MCIdle(_self->ob_itself);
  451.     _res = Py_BuildValue("l",
  452.                          _rv);
  453.     return _res;
  454. }
  455.  
  456. static PyObject *MovieCtlObj_MCKey(_self, _args)
  457.     MovieControllerObject *_self;
  458.     PyObject *_args;
  459. {
  460.     PyObject *_res = NULL;
  461.     ComponentResult _rv;
  462.     SInt8 key;
  463.     long modifiers;
  464.     if (!PyArg_ParseTuple(_args, "bl",
  465.                           &key,
  466.                           &modifiers))
  467.         return NULL;
  468.     _rv = MCKey(_self->ob_itself,
  469.                 key,
  470.                 modifiers);
  471.     _res = Py_BuildValue("l",
  472.                          _rv);
  473.     return _res;
  474. }
  475.  
  476. static PyObject *MovieCtlObj_MCClick(_self, _args)
  477.     MovieControllerObject *_self;
  478.     PyObject *_args;
  479. {
  480.     PyObject *_res = NULL;
  481.     ComponentResult _rv;
  482.     WindowPtr w;
  483.     Point where;
  484.     long when;
  485.     long modifiers;
  486.     if (!PyArg_ParseTuple(_args, "O&O&ll",
  487.                           WinObj_Convert, &w,
  488.                           PyMac_GetPoint, &where,
  489.                           &when,
  490.                           &modifiers))
  491.         return NULL;
  492.     _rv = MCClick(_self->ob_itself,
  493.                   w,
  494.                   where,
  495.                   when,
  496.                   modifiers);
  497.     _res = Py_BuildValue("l",
  498.                          _rv);
  499.     return _res;
  500. }
  501.  
  502. static PyObject *MovieCtlObj_MCEnableEditing(_self, _args)
  503.     MovieControllerObject *_self;
  504.     PyObject *_args;
  505. {
  506.     PyObject *_res = NULL;
  507.     ComponentResult _rv;
  508.     Boolean enabled;
  509.     if (!PyArg_ParseTuple(_args, "b",
  510.                           &enabled))
  511.         return NULL;
  512.     _rv = MCEnableEditing(_self->ob_itself,
  513.                           enabled);
  514.     _res = Py_BuildValue("l",
  515.                          _rv);
  516.     return _res;
  517. }
  518.  
  519. static PyObject *MovieCtlObj_MCIsEditingEnabled(_self, _args)
  520.     MovieControllerObject *_self;
  521.     PyObject *_args;
  522. {
  523.     PyObject *_res = NULL;
  524.     long _rv;
  525.     if (!PyArg_ParseTuple(_args, ""))
  526.         return NULL;
  527.     _rv = MCIsEditingEnabled(_self->ob_itself);
  528.     _res = Py_BuildValue("l",
  529.                          _rv);
  530.     return _res;
  531. }
  532.  
  533. static PyObject *MovieCtlObj_MCCopy(_self, _args)
  534.     MovieControllerObject *_self;
  535.     PyObject *_args;
  536. {
  537.     PyObject *_res = NULL;
  538.     Movie _rv;
  539.     if (!PyArg_ParseTuple(_args, ""))
  540.         return NULL;
  541.     _rv = MCCopy(_self->ob_itself);
  542.     _res = Py_BuildValue("O&",
  543.                          MovieObj_New, _rv);
  544.     return _res;
  545. }
  546.  
  547. static PyObject *MovieCtlObj_MCCut(_self, _args)
  548.     MovieControllerObject *_self;
  549.     PyObject *_args;
  550. {
  551.     PyObject *_res = NULL;
  552.     Movie _rv;
  553.     if (!PyArg_ParseTuple(_args, ""))
  554.         return NULL;
  555.     _rv = MCCut(_self->ob_itself);
  556.     _res = Py_BuildValue("O&",
  557.                          MovieObj_New, _rv);
  558.     return _res;
  559. }
  560.  
  561. static PyObject *MovieCtlObj_MCPaste(_self, _args)
  562.     MovieControllerObject *_self;
  563.     PyObject *_args;
  564. {
  565.     PyObject *_res = NULL;
  566.     ComponentResult _rv;
  567.     Movie srcMovie;
  568.     if (!PyArg_ParseTuple(_args, "O&",
  569.                           MovieObj_Convert, &srcMovie))
  570.         return NULL;
  571.     _rv = MCPaste(_self->ob_itself,
  572.                   srcMovie);
  573.     _res = Py_BuildValue("l",
  574.                          _rv);
  575.     return _res;
  576. }
  577.  
  578. static PyObject *MovieCtlObj_MCClear(_self, _args)
  579.     MovieControllerObject *_self;
  580.     PyObject *_args;
  581. {
  582.     PyObject *_res = NULL;
  583.     ComponentResult _rv;
  584.     if (!PyArg_ParseTuple(_args, ""))
  585.         return NULL;
  586.     _rv = MCClear(_self->ob_itself);
  587.     _res = Py_BuildValue("l",
  588.                          _rv);
  589.     return _res;
  590. }
  591.  
  592. static PyObject *MovieCtlObj_MCUndo(_self, _args)
  593.     MovieControllerObject *_self;
  594.     PyObject *_args;
  595. {
  596.     PyObject *_res = NULL;
  597.     ComponentResult _rv;
  598.     if (!PyArg_ParseTuple(_args, ""))
  599.         return NULL;
  600.     _rv = MCUndo(_self->ob_itself);
  601.     _res = Py_BuildValue("l",
  602.                          _rv);
  603.     return _res;
  604. }
  605.  
  606. static PyObject *MovieCtlObj_MCPositionController(_self, _args)
  607.     MovieControllerObject *_self;
  608.     PyObject *_args;
  609. {
  610.     PyObject *_res = NULL;
  611.     ComponentResult _rv;
  612.     Rect movieRect;
  613.     Rect controllerRect;
  614.     long someFlags;
  615.     if (!PyArg_ParseTuple(_args, "O&O&l",
  616.                           PyMac_GetRect, &movieRect,
  617.                           PyMac_GetRect, &controllerRect,
  618.                           &someFlags))
  619.         return NULL;
  620.     _rv = MCPositionController(_self->ob_itself,
  621.                                &movieRect,
  622.                                &controllerRect,
  623.                                someFlags);
  624.     _res = Py_BuildValue("l",
  625.                          _rv);
  626.     return _res;
  627. }
  628.  
  629. static PyObject *MovieCtlObj_MCGetControllerInfo(_self, _args)
  630.     MovieControllerObject *_self;
  631.     PyObject *_args;
  632. {
  633.     PyObject *_res = NULL;
  634.     ComponentResult _rv;
  635.     long someFlags;
  636.     if (!PyArg_ParseTuple(_args, ""))
  637.         return NULL;
  638.     _rv = MCGetControllerInfo(_self->ob_itself,
  639.                               &someFlags);
  640.     _res = Py_BuildValue("ll",
  641.                          _rv,
  642.                          someFlags);
  643.     return _res;
  644. }
  645.  
  646. static PyObject *MovieCtlObj_MCSetClip(_self, _args)
  647.     MovieControllerObject *_self;
  648.     PyObject *_args;
  649. {
  650.     PyObject *_res = NULL;
  651.     ComponentResult _rv;
  652.     RgnHandle theClip;
  653.     RgnHandle movieClip;
  654.     if (!PyArg_ParseTuple(_args, "O&O&",
  655.                           ResObj_Convert, &theClip,
  656.                           ResObj_Convert, &movieClip))
  657.         return NULL;
  658.     _rv = MCSetClip(_self->ob_itself,
  659.                     theClip,
  660.                     movieClip);
  661.     _res = Py_BuildValue("l",
  662.                          _rv);
  663.     return _res;
  664. }
  665.  
  666. static PyObject *MovieCtlObj_MCGetClip(_self, _args)
  667.     MovieControllerObject *_self;
  668.     PyObject *_args;
  669. {
  670.     PyObject *_res = NULL;
  671.     ComponentResult _rv;
  672.     RgnHandle theClip;
  673.     RgnHandle movieClip;
  674.     if (!PyArg_ParseTuple(_args, ""))
  675.         return NULL;
  676.     _rv = MCGetClip(_self->ob_itself,
  677.                     &theClip,
  678.                     &movieClip);
  679.     _res = Py_BuildValue("lO&O&",
  680.                          _rv,
  681.                          ResObj_New, theClip,
  682.                          ResObj_New, movieClip);
  683.     return _res;
  684. }
  685.  
  686. static PyObject *MovieCtlObj_MCDrawBadge(_self, _args)
  687.     MovieControllerObject *_self;
  688.     PyObject *_args;
  689. {
  690.     PyObject *_res = NULL;
  691.     ComponentResult _rv;
  692.     RgnHandle movieRgn;
  693.     RgnHandle badgeRgn;
  694.     if (!PyArg_ParseTuple(_args, "O&",
  695.                           ResObj_Convert, &movieRgn))
  696.         return NULL;
  697.     _rv = MCDrawBadge(_self->ob_itself,
  698.                       movieRgn,
  699.                       &badgeRgn);
  700.     _res = Py_BuildValue("lO&",
  701.                          _rv,
  702.                          ResObj_New, badgeRgn);
  703.     return _res;
  704. }
  705.  
  706. static PyObject *MovieCtlObj_MCSetUpEditMenu(_self, _args)
  707.     MovieControllerObject *_self;
  708.     PyObject *_args;
  709. {
  710.     PyObject *_res = NULL;
  711.     ComponentResult _rv;
  712.     long modifiers;
  713.     MenuHandle mh;
  714.     if (!PyArg_ParseTuple(_args, "lO&",
  715.                           &modifiers,
  716.                           MenuObj_Convert, &mh))
  717.         return NULL;
  718.     _rv = MCSetUpEditMenu(_self->ob_itself,
  719.                           modifiers,
  720.                           mh);
  721.     _res = Py_BuildValue("l",
  722.                          _rv);
  723.     return _res;
  724. }
  725.  
  726. static PyObject *MovieCtlObj_MCGetMenuString(_self, _args)
  727.     MovieControllerObject *_self;
  728.     PyObject *_args;
  729. {
  730.     PyObject *_res = NULL;
  731.     ComponentResult _rv;
  732.     long modifiers;
  733.     short item;
  734.     Str255 aString;
  735.     if (!PyArg_ParseTuple(_args, "lhO&",
  736.                           &modifiers,
  737.                           &item,
  738.                           PyMac_GetStr255, aString))
  739.         return NULL;
  740.     _rv = MCGetMenuString(_self->ob_itself,
  741.                           modifiers,
  742.                           item,
  743.                           aString);
  744.     _res = Py_BuildValue("l",
  745.                          _rv);
  746.     return _res;
  747. }
  748.  
  749. static PyMethodDef MovieCtlObj_methods[] = {
  750.     {"MCSetMovie", (PyCFunction)MovieCtlObj_MCSetMovie, 1,
  751.      "(Movie theMovie, WindowPtr movieWindow, Point where) -> (ComponentResult _rv)"},
  752.     {"MCGetIndMovie", (PyCFunction)MovieCtlObj_MCGetIndMovie, 1,
  753.      "(short index) -> (Movie _rv)"},
  754.     {"MCRemoveMovie", (PyCFunction)MovieCtlObj_MCRemoveMovie, 1,
  755.      "() -> (ComponentResult _rv)"},
  756.     {"MCIsPlayerEvent", (PyCFunction)MovieCtlObj_MCIsPlayerEvent, 1,
  757.      "(EventRecord e) -> (ComponentResult _rv)"},
  758.     {"MCDoAction", (PyCFunction)MovieCtlObj_MCDoAction, 1,
  759.      "(short action, void * params) -> (ComponentResult _rv)"},
  760.     {"MCSetControllerAttached", (PyCFunction)MovieCtlObj_MCSetControllerAttached, 1,
  761.      "(Boolean attach) -> (ComponentResult _rv)"},
  762.     {"MCIsControllerAttached", (PyCFunction)MovieCtlObj_MCIsControllerAttached, 1,
  763.      "() -> (ComponentResult _rv)"},
  764.     {"MCSetVisible", (PyCFunction)MovieCtlObj_MCSetVisible, 1,
  765.      "(Boolean visible) -> (ComponentResult _rv)"},
  766.     {"MCGetVisible", (PyCFunction)MovieCtlObj_MCGetVisible, 1,
  767.      "() -> (ComponentResult _rv)"},
  768.     {"MCGetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRect, 1,
  769.      "() -> (ComponentResult _rv, Rect bounds)"},
  770.     {"MCSetControllerBoundsRect", (PyCFunction)MovieCtlObj_MCSetControllerBoundsRect, 1,
  771.      "(Rect bounds) -> (ComponentResult _rv)"},
  772.     {"MCGetControllerBoundsRgn", (PyCFunction)MovieCtlObj_MCGetControllerBoundsRgn, 1,
  773.      "() -> (RgnHandle _rv)"},
  774.     {"MCGetWindowRgn", (PyCFunction)MovieCtlObj_MCGetWindowRgn, 1,
  775.      "(WindowPtr w) -> (RgnHandle _rv)"},
  776.     {"MCMovieChanged", (PyCFunction)MovieCtlObj_MCMovieChanged, 1,
  777.      "(Movie m) -> (ComponentResult _rv)"},
  778.     {"MCSetDuration", (PyCFunction)MovieCtlObj_MCSetDuration, 1,
  779.      "(TimeValue duration) -> (ComponentResult _rv)"},
  780.     {"MCGetCurrentTime", (PyCFunction)MovieCtlObj_MCGetCurrentTime, 1,
  781.      "() -> (TimeValue _rv, TimeScale scale)"},
  782.     {"MCNewAttachedController", (PyCFunction)MovieCtlObj_MCNewAttachedController, 1,
  783.      "(Movie theMovie, WindowPtr w, Point where) -> (ComponentResult _rv)"},
  784.     {"MCDraw", (PyCFunction)MovieCtlObj_MCDraw, 1,
  785.      "(WindowPtr w) -> (ComponentResult _rv)"},
  786.     {"MCActivate", (PyCFunction)MovieCtlObj_MCActivate, 1,
  787.      "(WindowPtr w, Boolean activate) -> (ComponentResult _rv)"},
  788.     {"MCIdle", (PyCFunction)MovieCtlObj_MCIdle, 1,
  789.      "() -> (ComponentResult _rv)"},
  790.     {"MCKey", (PyCFunction)MovieCtlObj_MCKey, 1,
  791.      "(SInt8 key, long modifiers) -> (ComponentResult _rv)"},
  792.     {"MCClick", (PyCFunction)MovieCtlObj_MCClick, 1,
  793.      "(WindowPtr w, Point where, long when, long modifiers) -> (ComponentResult _rv)"},
  794.     {"MCEnableEditing", (PyCFunction)MovieCtlObj_MCEnableEditing, 1,
  795.      "(Boolean enabled) -> (ComponentResult _rv)"},
  796.     {"MCIsEditingEnabled", (PyCFunction)MovieCtlObj_MCIsEditingEnabled, 1,
  797.      "() -> (long _rv)"},
  798.     {"MCCopy", (PyCFunction)MovieCtlObj_MCCopy, 1,
  799.      "() -> (Movie _rv)"},
  800.     {"MCCut", (PyCFunction)MovieCtlObj_MCCut, 1,
  801.      "() -> (Movie _rv)"},
  802.     {"MCPaste", (PyCFunction)MovieCtlObj_MCPaste, 1,
  803.      "(Movie srcMovie) -> (ComponentResult _rv)"},
  804.     {"MCClear", (PyCFunction)MovieCtlObj_MCClear, 1,
  805.      "() -> (ComponentResult _rv)"},
  806.     {"MCUndo", (PyCFunction)MovieCtlObj_MCUndo, 1,
  807.      "() -> (ComponentResult _rv)"},
  808.     {"MCPositionController", (PyCFunction)MovieCtlObj_MCPositionController, 1,
  809.      "(Rect movieRect, Rect controllerRect, long someFlags) -> (ComponentResult _rv)"},
  810.     {"MCGetControllerInfo", (PyCFunction)MovieCtlObj_MCGetControllerInfo, 1,
  811.      "() -> (ComponentResult _rv, long someFlags)"},
  812.     {"MCSetClip", (PyCFunction)MovieCtlObj_MCSetClip, 1,
  813.      "(RgnHandle theClip, RgnHandle movieClip) -> (ComponentResult _rv)"},
  814.     {"MCGetClip", (PyCFunction)MovieCtlObj_MCGetClip, 1,
  815.      "() -> (ComponentResult _rv, RgnHandle theClip, RgnHandle movieClip)"},
  816.     {"MCDrawBadge", (PyCFunction)MovieCtlObj_MCDrawBadge, 1,
  817.      "(RgnHandle movieRgn) -> (ComponentResult _rv, RgnHandle badgeRgn)"},
  818.     {"MCSetUpEditMenu", (PyCFunction)MovieCtlObj_MCSetUpEditMenu, 1,
  819.      "(long modifiers, MenuHandle mh) -> (ComponentResult _rv)"},
  820.     {"MCGetMenuString", (PyCFunction)MovieCtlObj_MCGetMenuString, 1,
  821.      "(long modifiers, short item, Str255 aString) -> (ComponentResult _rv)"},
  822.     {NULL, NULL, 0}
  823. };
  824.  
  825. PyMethodChain MovieCtlObj_chain = { MovieCtlObj_methods, NULL };
  826.  
  827. static PyObject *MovieCtlObj_getattr(self, name)
  828.     MovieControllerObject *self;
  829.     char *name;
  830. {
  831.     return Py_FindMethodInChain(&MovieCtlObj_chain, (PyObject *)self, name);
  832. }
  833.  
  834. #define MovieCtlObj_setattr NULL
  835.  
  836. PyTypeObject MovieController_Type = {
  837.     PyObject_HEAD_INIT(&PyType_Type)
  838.     0, /*ob_size*/
  839.     "MovieController", /*tp_name*/
  840.     sizeof(MovieControllerObject), /*tp_basicsize*/
  841.     0, /*tp_itemsize*/
  842.     /* methods */
  843.     (destructor) MovieCtlObj_dealloc, /*tp_dealloc*/
  844.     0, /*tp_print*/
  845.     (getattrfunc) MovieCtlObj_getattr, /*tp_getattr*/
  846.     (setattrfunc) MovieCtlObj_setattr, /*tp_setattr*/
  847. };
  848.  
  849. /* ---------------- End object type MovieController ----------------- */
  850.  
  851.  
  852. /* ---------------------- Object type TimeBase ---------------------- */
  853.  
  854. PyTypeObject TimeBase_Type;
  855.  
  856. #define TimeBaseObj_Check(x) ((x)->ob_type == &TimeBase_Type)
  857.  
  858. typedef struct TimeBaseObject {
  859.     PyObject_HEAD
  860.     TimeBase ob_itself;
  861. } TimeBaseObject;
  862.  
  863. PyObject *TimeBaseObj_New(itself)
  864.     TimeBase itself;
  865. {
  866.     TimeBaseObject *it;
  867.     if (itself == NULL) {
  868.                         PyErr_SetString(Qt_Error,"Cannot create null TimeBase");
  869.                         return NULL;
  870.                     }
  871.     it = PyObject_NEW(TimeBaseObject, &TimeBase_Type);
  872.     if (it == NULL) return NULL;
  873.     it->ob_itself = itself;
  874.     return (PyObject *)it;
  875. }
  876. TimeBaseObj_Convert(v, p_itself)
  877.     PyObject *v;
  878.     TimeBase *p_itself;
  879. {
  880.     if (!TimeBaseObj_Check(v))
  881.     {
  882.         PyErr_SetString(PyExc_TypeError, "TimeBase required");
  883.         return 0;
  884.     }
  885.     *p_itself = ((TimeBaseObject *)v)->ob_itself;
  886.     return 1;
  887. }
  888.  
  889. static void TimeBaseObj_dealloc(self)
  890.     TimeBaseObject *self;
  891. {
  892.     DisposeTimeBase(self->ob_itself);
  893.     PyMem_DEL(self);
  894. }
  895.  
  896. static PyObject *TimeBaseObj_SetTimeBaseValue(_self, _args)
  897.     TimeBaseObject *_self;
  898.     PyObject *_args;
  899. {
  900.     PyObject *_res = NULL;
  901.     TimeValue t;
  902.     TimeScale s;
  903.     if (!PyArg_ParseTuple(_args, "ll",
  904.                           &t,
  905.                           &s))
  906.         return NULL;
  907.     SetTimeBaseValue(_self->ob_itself,
  908.                      t,
  909.                      s);
  910.     Py_INCREF(Py_None);
  911.     _res = Py_None;
  912.     return _res;
  913. }
  914.  
  915. static PyObject *TimeBaseObj_GetTimeBaseRate(_self, _args)
  916.     TimeBaseObject *_self;
  917.     PyObject *_args;
  918. {
  919.     PyObject *_res = NULL;
  920.     Fixed _rv;
  921.     if (!PyArg_ParseTuple(_args, ""))
  922.         return NULL;
  923.     _rv = GetTimeBaseRate(_self->ob_itself);
  924.     _res = Py_BuildValue("O&",
  925.                          PyMac_BuildFixed, _rv);
  926.     return _res;
  927. }
  928.  
  929. static PyObject *TimeBaseObj_SetTimeBaseRate(_self, _args)
  930.     TimeBaseObject *_self;
  931.     PyObject *_args;
  932. {
  933.     PyObject *_res = NULL;
  934.     Fixed r;
  935.     if (!PyArg_ParseTuple(_args, "O&",
  936.                           PyMac_GetFixed, &r))
  937.         return NULL;
  938.     SetTimeBaseRate(_self->ob_itself,
  939.                     r);
  940.     Py_INCREF(Py_None);
  941.     _res = Py_None;
  942.     return _res;
  943. }
  944.  
  945. static PyObject *TimeBaseObj_GetTimeBaseFlags(_self, _args)
  946.     TimeBaseObject *_self;
  947.     PyObject *_args;
  948. {
  949.     PyObject *_res = NULL;
  950.     long _rv;
  951.     if (!PyArg_ParseTuple(_args, ""))
  952.         return NULL;
  953.     _rv = GetTimeBaseFlags(_self->ob_itself);
  954.     _res = Py_BuildValue("l",
  955.                          _rv);
  956.     return _res;
  957. }
  958.  
  959. static PyObject *TimeBaseObj_SetTimeBaseFlags(_self, _args)
  960.     TimeBaseObject *_self;
  961.     PyObject *_args;
  962. {
  963.     PyObject *_res = NULL;
  964.     long timeBaseFlags;
  965.     if (!PyArg_ParseTuple(_args, "l",
  966.                           &timeBaseFlags))
  967.         return NULL;
  968.     SetTimeBaseFlags(_self->ob_itself,
  969.                      timeBaseFlags);
  970.     Py_INCREF(Py_None);
  971.     _res = Py_None;
  972.     return _res;
  973. }
  974.  
  975. static PyObject *TimeBaseObj_GetTimeBaseMasterTimeBase(_self, _args)
  976.     TimeBaseObject *_self;
  977.     PyObject *_args;
  978. {
  979.     PyObject *_res = NULL;
  980.     TimeBase _rv;
  981.     if (!PyArg_ParseTuple(_args, ""))
  982.         return NULL;
  983.     _rv = GetTimeBaseMasterTimeBase(_self->ob_itself);
  984.     _res = Py_BuildValue("O&",
  985.                          TimeBaseObj_New, _rv);
  986.     return _res;
  987. }
  988.  
  989. static PyObject *TimeBaseObj_GetTimeBaseMasterClock(_self, _args)
  990.     TimeBaseObject *_self;
  991.     PyObject *_args;
  992. {
  993.     PyObject *_res = NULL;
  994.     ComponentInstance _rv;
  995.     if (!PyArg_ParseTuple(_args, ""))
  996.         return NULL;
  997.     _rv = GetTimeBaseMasterClock(_self->ob_itself);
  998.     _res = Py_BuildValue("O&",
  999.                          CmpInstObj_New, _rv);
  1000.     return _res;
  1001. }
  1002.  
  1003. static PyObject *TimeBaseObj_GetTimeBaseEffectiveRate(_self, _args)
  1004.     TimeBaseObject *_self;
  1005.     PyObject *_args;
  1006. {
  1007.     PyObject *_res = NULL;
  1008.     Fixed _rv;
  1009.     if (!PyArg_ParseTuple(_args, ""))
  1010.         return NULL;
  1011.     _rv = GetTimeBaseEffectiveRate(_self->ob_itself);
  1012.     _res = Py_BuildValue("O&",
  1013.                          PyMac_BuildFixed, _rv);
  1014.     return _res;
  1015. }
  1016.  
  1017. static PyMethodDef TimeBaseObj_methods[] = {
  1018.     {"SetTimeBaseValue", (PyCFunction)TimeBaseObj_SetTimeBaseValue, 1,
  1019.      "(TimeValue t, TimeScale s) -> None"},
  1020.     {"GetTimeBaseRate", (PyCFunction)TimeBaseObj_GetTimeBaseRate, 1,
  1021.      "() -> (Fixed _rv)"},
  1022.     {"SetTimeBaseRate", (PyCFunction)TimeBaseObj_SetTimeBaseRate, 1,
  1023.      "(Fixed r) -> None"},
  1024.     {"GetTimeBaseFlags", (PyCFunction)TimeBaseObj_GetTimeBaseFlags, 1,
  1025.      "() -> (long _rv)"},
  1026.     {"SetTimeBaseFlags", (PyCFunction)TimeBaseObj_SetTimeBaseFlags, 1,
  1027.      "(long timeBaseFlags) -> None"},
  1028.     {"GetTimeBaseMasterTimeBase", (PyCFunction)TimeBaseObj_GetTimeBaseMasterTimeBase, 1,
  1029.      "() -> (TimeBase _rv)"},
  1030.     {"GetTimeBaseMasterClock", (PyCFunction)TimeBaseObj_GetTimeBaseMasterClock, 1,
  1031.      "() -> (ComponentInstance _rv)"},
  1032.     {"GetTimeBaseEffectiveRate", (PyCFunction)TimeBaseObj_GetTimeBaseEffectiveRate, 1,
  1033.      "() -> (Fixed _rv)"},
  1034.     {NULL, NULL, 0}
  1035. };
  1036.  
  1037. PyMethodChain TimeBaseObj_chain = { TimeBaseObj_methods, NULL };
  1038.  
  1039. static PyObject *TimeBaseObj_getattr(self, name)
  1040.     TimeBaseObject *self;
  1041.     char *name;
  1042. {
  1043.     return Py_FindMethodInChain(&TimeBaseObj_chain, (PyObject *)self, name);
  1044. }
  1045.  
  1046. #define TimeBaseObj_setattr NULL
  1047.  
  1048. PyTypeObject TimeBase_Type = {
  1049.     PyObject_HEAD_INIT(&PyType_Type)
  1050.     0, /*ob_size*/
  1051.     "TimeBase", /*tp_name*/
  1052.     sizeof(TimeBaseObject), /*tp_basicsize*/
  1053.     0, /*tp_itemsize*/
  1054.     /* methods */
  1055.     (destructor) TimeBaseObj_dealloc, /*tp_dealloc*/
  1056.     0, /*tp_print*/
  1057.     (getattrfunc) TimeBaseObj_getattr, /*tp_getattr*/
  1058.     (setattrfunc) TimeBaseObj_setattr, /*tp_setattr*/
  1059. };
  1060.  
  1061. /* -------------------- End object type TimeBase -------------------- */
  1062.  
  1063.  
  1064. /* ---------------------- Object type UserData ---------------------- */
  1065.  
  1066. PyTypeObject UserData_Type;
  1067.  
  1068. #define UserDataObj_Check(x) ((x)->ob_type == &UserData_Type)
  1069.  
  1070. typedef struct UserDataObject {
  1071.     PyObject_HEAD
  1072.     UserData ob_itself;
  1073. } UserDataObject;
  1074.  
  1075. PyObject *UserDataObj_New(itself)
  1076.     UserData itself;
  1077. {
  1078.     UserDataObject *it;
  1079.     if (itself == NULL) {
  1080.                         PyErr_SetString(Qt_Error,"Cannot create null UserData");
  1081.                         return NULL;
  1082.                     }
  1083.     it = PyObject_NEW(UserDataObject, &UserData_Type);
  1084.     if (it == NULL) return NULL;
  1085.     it->ob_itself = itself;
  1086.     return (PyObject *)it;
  1087. }
  1088. UserDataObj_Convert(v, p_itself)
  1089.     PyObject *v;
  1090.     UserData *p_itself;
  1091. {
  1092.     if (!UserDataObj_Check(v))
  1093.     {
  1094.         PyErr_SetString(PyExc_TypeError, "UserData required");
  1095.         return 0;
  1096.     }
  1097.     *p_itself = ((UserDataObject *)v)->ob_itself;
  1098.     return 1;
  1099. }
  1100.  
  1101. static void UserDataObj_dealloc(self)
  1102.     UserDataObject *self;
  1103. {
  1104.     DisposeUserData(self->ob_itself);
  1105.     PyMem_DEL(self);
  1106. }
  1107.  
  1108. static PyObject *UserDataObj_GetUserData(_self, _args)
  1109.     UserDataObject *_self;
  1110.     PyObject *_args;
  1111. {
  1112.     PyObject *_res = NULL;
  1113.     OSErr _err;
  1114.     Handle data;
  1115.     OSType udType;
  1116.     long index;
  1117.     if (!PyArg_ParseTuple(_args, "O&O&l",
  1118.                           ResObj_Convert, &data,
  1119.                           PyMac_GetOSType, &udType,
  1120.                           &index))
  1121.         return NULL;
  1122.     _err = GetUserData(_self->ob_itself,
  1123.                        data,
  1124.                        udType,
  1125.                        index);
  1126.     if (_err != noErr) return PyMac_Error(_err);
  1127.     Py_INCREF(Py_None);
  1128.     _res = Py_None;
  1129.     return _res;
  1130. }
  1131.  
  1132. static PyObject *UserDataObj_AddUserData(_self, _args)
  1133.     UserDataObject *_self;
  1134.     PyObject *_args;
  1135. {
  1136.     PyObject *_res = NULL;
  1137.     OSErr _err;
  1138.     Handle data;
  1139.     OSType udType;
  1140.     if (!PyArg_ParseTuple(_args, "O&O&",
  1141.                           ResObj_Convert, &data,
  1142.                           PyMac_GetOSType, &udType))
  1143.         return NULL;
  1144.     _err = AddUserData(_self->ob_itself,
  1145.                        data,
  1146.                        udType);
  1147.     if (_err != noErr) return PyMac_Error(_err);
  1148.     Py_INCREF(Py_None);
  1149.     _res = Py_None;
  1150.     return _res;
  1151. }
  1152.  
  1153. static PyObject *UserDataObj_RemoveUserData(_self, _args)
  1154.     UserDataObject *_self;
  1155.     PyObject *_args;
  1156. {
  1157.     PyObject *_res = NULL;
  1158.     OSErr _err;
  1159.     OSType udType;
  1160.     long index;
  1161.     if (!PyArg_ParseTuple(_args, "O&l",
  1162.                           PyMac_GetOSType, &udType,
  1163.                           &index))
  1164.         return NULL;
  1165.     _err = RemoveUserData(_self->ob_itself,
  1166.                           udType,
  1167.                           index);
  1168.     if (_err != noErr) return PyMac_Error(_err);
  1169.     Py_INCREF(Py_None);
  1170.     _res = Py_None;
  1171.     return _res;
  1172. }
  1173.  
  1174. static PyObject *UserDataObj_CountUserDataType(_self, _args)
  1175.     UserDataObject *_self;
  1176.     PyObject *_args;
  1177. {
  1178.     PyObject *_res = NULL;
  1179.     short _rv;
  1180.     OSType udType;
  1181.     if (!PyArg_ParseTuple(_args, "O&",
  1182.                           PyMac_GetOSType, &udType))
  1183.         return NULL;
  1184.     _rv = CountUserDataType(_self->ob_itself,
  1185.                             udType);
  1186.     _res = Py_BuildValue("h",
  1187.                          _rv);
  1188.     return _res;
  1189. }
  1190.  
  1191. static PyObject *UserDataObj_GetNextUserDataType(_self, _args)
  1192.     UserDataObject *_self;
  1193.     PyObject *_args;
  1194. {
  1195.     PyObject *_res = NULL;
  1196.     long _rv;
  1197.     OSType udType;
  1198.     if (!PyArg_ParseTuple(_args, "O&",
  1199.                           PyMac_GetOSType, &udType))
  1200.         return NULL;
  1201.     _rv = GetNextUserDataType(_self->ob_itself,
  1202.                               udType);
  1203.     _res = Py_BuildValue("l",
  1204.                          _rv);
  1205.     return _res;
  1206. }
  1207.  
  1208. static PyObject *UserDataObj_AddUserDataText(_self, _args)
  1209.     UserDataObject *_self;
  1210.     PyObject *_args;
  1211. {
  1212.     PyObject *_res = NULL;
  1213.     OSErr _err;
  1214.     Handle data;
  1215.     OSType udType;
  1216.     long index;
  1217.     short itlRegionTag;
  1218.     if (!PyArg_ParseTuple(_args, "O&O&lh",
  1219.                           ResObj_Convert, &data,
  1220.                           PyMac_GetOSType, &udType,
  1221.                           &index,
  1222.                           &itlRegionTag))
  1223.         return NULL;
  1224.     _err = AddUserDataText(_self->ob_itself,
  1225.                            data,
  1226.                            udType,
  1227.                            index,
  1228.                            itlRegionTag);
  1229.     if (_err != noErr) return PyMac_Error(_err);
  1230.     Py_INCREF(Py_None);
  1231.     _res = Py_None;
  1232.     return _res;
  1233. }
  1234.  
  1235. static PyObject *UserDataObj_GetUserDataText(_self, _args)
  1236.     UserDataObject *_self;
  1237.     PyObject *_args;
  1238. {
  1239.     PyObject *_res = NULL;
  1240.     OSErr _err;
  1241.     Handle data;
  1242.     OSType udType;
  1243.     long index;
  1244.     short itlRegionTag;
  1245.     if (!PyArg_ParseTuple(_args, "O&O&lh",
  1246.                           ResObj_Convert, &data,
  1247.                           PyMac_GetOSType, &udType,
  1248.                           &index,
  1249.                           &itlRegionTag))
  1250.         return NULL;
  1251.     _err = GetUserDataText(_self->ob_itself,
  1252.                            data,
  1253.                            udType,
  1254.                            index,
  1255.                            itlRegionTag);
  1256.     if (_err != noErr) return PyMac_Error(_err);
  1257.     Py_INCREF(Py_None);
  1258.     _res = Py_None;
  1259.     return _res;
  1260. }
  1261.  
  1262. static PyObject *UserDataObj_RemoveUserDataText(_self, _args)
  1263.     UserDataObject *_self;
  1264.     PyObject *_args;
  1265. {
  1266.     PyObject *_res = NULL;
  1267.     OSErr _err;
  1268.     OSType udType;
  1269.     long index;
  1270.     short itlRegionTag;
  1271.     if (!PyArg_ParseTuple(_args, "O&lh",
  1272.                           PyMac_GetOSType, &udType,
  1273.                           &index,
  1274.                           &itlRegionTag))
  1275.         return NULL;
  1276.     _err = RemoveUserDataText(_self->ob_itself,
  1277.                               udType,
  1278.                               index,
  1279.                               itlRegionTag);
  1280.     if (_err != noErr) return PyMac_Error(_err);
  1281.     Py_INCREF(Py_None);
  1282.     _res = Py_None;
  1283.     return _res;
  1284. }
  1285.  
  1286. static PyObject *UserDataObj_PutUserDataIntoHandle(_self, _args)
  1287.     UserDataObject *_self;
  1288.     PyObject *_args;
  1289. {
  1290.     PyObject *_res = NULL;
  1291.     OSErr _err;
  1292.     Handle h;
  1293.     if (!PyArg_ParseTuple(_args, "O&",
  1294.                           ResObj_Convert, &h))
  1295.         return NULL;
  1296.     _err = PutUserDataIntoHandle(_self->ob_itself,
  1297.                                  h);
  1298.     if (_err != noErr) return PyMac_Error(_err);
  1299.     Py_INCREF(Py_None);
  1300.     _res = Py_None;
  1301.     return _res;
  1302. }
  1303.  
  1304. static PyMethodDef UserDataObj_methods[] = {
  1305.     {"GetUserData", (PyCFunction)UserDataObj_GetUserData, 1,
  1306.      "(Handle data, OSType udType, long index) -> None"},
  1307.     {"AddUserData", (PyCFunction)UserDataObj_AddUserData, 1,
  1308.      "(Handle data, OSType udType) -> None"},
  1309.     {"RemoveUserData", (PyCFunction)UserDataObj_RemoveUserData, 1,
  1310.      "(OSType udType, long index) -> None"},
  1311.     {"CountUserDataType", (PyCFunction)UserDataObj_CountUserDataType, 1,
  1312.      "(OSType udType) -> (short _rv)"},
  1313.     {"GetNextUserDataType", (PyCFunction)UserDataObj_GetNextUserDataType, 1,
  1314.      "(OSType udType) -> (long _rv)"},
  1315.     {"AddUserDataText", (PyCFunction)UserDataObj_AddUserDataText, 1,
  1316.      "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
  1317.     {"GetUserDataText", (PyCFunction)UserDataObj_GetUserDataText, 1,
  1318.      "(Handle data, OSType udType, long index, short itlRegionTag) -> None"},
  1319.     {"RemoveUserDataText", (PyCFunction)UserDataObj_RemoveUserDataText, 1,
  1320.      "(OSType udType, long index, short itlRegionTag) -> None"},
  1321.     {"PutUserDataIntoHandle", (PyCFunction)UserDataObj_PutUserDataIntoHandle, 1,
  1322.      "(Handle h) -> None"},
  1323.     {NULL, NULL, 0}
  1324. };
  1325.  
  1326. PyMethodChain UserDataObj_chain = { UserDataObj_methods, NULL };
  1327.  
  1328. static PyObject *UserDataObj_getattr(self, name)
  1329.     UserDataObject *self;
  1330.     char *name;
  1331. {
  1332.     return Py_FindMethodInChain(&UserDataObj_chain, (PyObject *)self, name);
  1333. }
  1334.  
  1335. #define UserDataObj_setattr NULL
  1336.  
  1337. PyTypeObject UserData_Type = {
  1338.     PyObject_HEAD_INIT(&PyType_Type)
  1339.     0, /*ob_size*/
  1340.     "UserData", /*tp_name*/
  1341.     sizeof(UserDataObject), /*tp_basicsize*/
  1342.     0, /*tp_itemsize*/
  1343.     /* methods */
  1344.     (destructor) UserDataObj_dealloc, /*tp_dealloc*/
  1345.     0, /*tp_print*/
  1346.     (getattrfunc) UserDataObj_getattr, /*tp_getattr*/
  1347.     (setattrfunc) UserDataObj_setattr, /*tp_setattr*/
  1348. };
  1349.  
  1350. /* -------------------- End object type UserData -------------------- */
  1351.  
  1352.  
  1353. /* ----------------------- Object type Media ------------------------ */
  1354.  
  1355. PyTypeObject Media_Type;
  1356.  
  1357. #define MediaObj_Check(x) ((x)->ob_type == &Media_Type)
  1358.  
  1359. typedef struct MediaObject {
  1360.     PyObject_HEAD
  1361.     Media ob_itself;
  1362. } MediaObject;
  1363.  
  1364. PyObject *MediaObj_New(itself)
  1365.     Media itself;
  1366. {
  1367.     MediaObject *it;
  1368.     if (itself == NULL) {
  1369.                         PyErr_SetString(Qt_Error,"Cannot create null Media");
  1370.                         return NULL;
  1371.                     }
  1372.     it = PyObject_NEW(MediaObject, &Media_Type);
  1373.     if (it == NULL) return NULL;
  1374.     it->ob_itself = itself;
  1375.     return (PyObject *)it;
  1376. }
  1377. MediaObj_Convert(v, p_itself)
  1378.     PyObject *v;
  1379.     Media *p_itself;
  1380. {
  1381.     if (!MediaObj_Check(v))
  1382.     {
  1383.         PyErr_SetString(PyExc_TypeError, "Media required");
  1384.         return 0;
  1385.     }
  1386.     *p_itself = ((MediaObject *)v)->ob_itself;
  1387.     return 1;
  1388. }
  1389.  
  1390. static void MediaObj_dealloc(self)
  1391.     MediaObject *self;
  1392. {
  1393.     DisposeTrackMedia(self->ob_itself);
  1394.     PyMem_DEL(self);
  1395. }
  1396.  
  1397. static PyObject *MediaObj_LoadMediaIntoRam(_self, _args)
  1398.     MediaObject *_self;
  1399.     PyObject *_args;
  1400. {
  1401.     PyObject *_res = NULL;
  1402.     OSErr _err;
  1403.     TimeValue time;
  1404.     TimeValue duration;
  1405.     long flags;
  1406.     if (!PyArg_ParseTuple(_args, "lll",
  1407.                           &time,
  1408.                           &duration,
  1409.                           &flags))
  1410.         return NULL;
  1411.     _err = LoadMediaIntoRam(_self->ob_itself,
  1412.                             time,
  1413.                             duration,
  1414.                             flags);
  1415.     if (_err != noErr) return PyMac_Error(_err);
  1416.     Py_INCREF(Py_None);
  1417.     _res = Py_None;
  1418.     return _res;
  1419. }
  1420.  
  1421. static PyObject *MediaObj_GetMediaTrack(_self, _args)
  1422.     MediaObject *_self;
  1423.     PyObject *_args;
  1424. {
  1425.     PyObject *_res = NULL;
  1426.     Track _rv;
  1427.     if (!PyArg_ParseTuple(_args, ""))
  1428.         return NULL;
  1429.     _rv = GetMediaTrack(_self->ob_itself);
  1430.     _res = Py_BuildValue("O&",
  1431.                          TrackObj_New, _rv);
  1432.     return _res;
  1433. }
  1434.  
  1435. static PyObject *MediaObj_GetMediaTimeScale(_self, _args)
  1436.     MediaObject *_self;
  1437.     PyObject *_args;
  1438. {
  1439.     PyObject *_res = NULL;
  1440.     TimeScale _rv;
  1441.     if (!PyArg_ParseTuple(_args, ""))
  1442.         return NULL;
  1443.     _rv = GetMediaTimeScale(_self->ob_itself);
  1444.     _res = Py_BuildValue("l",
  1445.                          _rv);
  1446.     return _res;
  1447. }
  1448.  
  1449. static PyObject *MediaObj_SetMediaTimeScale(_self, _args)
  1450.     MediaObject *_self;
  1451.     PyObject *_args;
  1452. {
  1453.     PyObject *_res = NULL;
  1454.     TimeScale timeScale;
  1455.     if (!PyArg_ParseTuple(_args, "l",
  1456.                           &timeScale))
  1457.         return NULL;
  1458.     SetMediaTimeScale(_self->ob_itself,
  1459.                       timeScale);
  1460.     Py_INCREF(Py_None);
  1461.     _res = Py_None;
  1462.     return _res;
  1463. }
  1464.  
  1465. static PyObject *MediaObj_GetMediaDuration(_self, _args)
  1466.     MediaObject *_self;
  1467.     PyObject *_args;
  1468. {
  1469.     PyObject *_res = NULL;
  1470.     TimeValue _rv;
  1471.     if (!PyArg_ParseTuple(_args, ""))
  1472.         return NULL;
  1473.     _rv = GetMediaDuration(_self->ob_itself);
  1474.     _res = Py_BuildValue("l",
  1475.                          _rv);
  1476.     return _res;
  1477. }
  1478.  
  1479. static PyObject *MediaObj_GetMediaLanguage(_self, _args)
  1480.     MediaObject *_self;
  1481.     PyObject *_args;
  1482. {
  1483.     PyObject *_res = NULL;
  1484.     short _rv;
  1485.     if (!PyArg_ParseTuple(_args, ""))
  1486.         return NULL;
  1487.     _rv = GetMediaLanguage(_self->ob_itself);
  1488.     _res = Py_BuildValue("h",
  1489.                          _rv);
  1490.     return _res;
  1491. }
  1492.  
  1493. static PyObject *MediaObj_SetMediaLanguage(_self, _args)
  1494.     MediaObject *_self;
  1495.     PyObject *_args;
  1496. {
  1497.     PyObject *_res = NULL;
  1498.     short language;
  1499.     if (!PyArg_ParseTuple(_args, "h",
  1500.                           &language))
  1501.         return NULL;
  1502.     SetMediaLanguage(_self->ob_itself,
  1503.                      language);
  1504.     Py_INCREF(Py_None);
  1505.     _res = Py_None;
  1506.     return _res;
  1507. }
  1508.  
  1509. static PyObject *MediaObj_GetMediaQuality(_self, _args)
  1510.     MediaObject *_self;
  1511.     PyObject *_args;
  1512. {
  1513.     PyObject *_res = NULL;
  1514.     short _rv;
  1515.     if (!PyArg_ParseTuple(_args, ""))
  1516.         return NULL;
  1517.     _rv = GetMediaQuality(_self->ob_itself);
  1518.     _res = Py_BuildValue("h",
  1519.                          _rv);
  1520.     return _res;
  1521. }
  1522.  
  1523. static PyObject *MediaObj_SetMediaQuality(_self, _args)
  1524.     MediaObject *_self;
  1525.     PyObject *_args;
  1526. {
  1527.     PyObject *_res = NULL;
  1528.     short quality;
  1529.     if (!PyArg_ParseTuple(_args, "h",
  1530.                           &quality))
  1531.         return NULL;
  1532.     SetMediaQuality(_self->ob_itself,
  1533.                     quality);
  1534.     Py_INCREF(Py_None);
  1535.     _res = Py_None;
  1536.     return _res;
  1537. }
  1538.  
  1539. static PyObject *MediaObj_GetMediaHandlerDescription(_self, _args)
  1540.     MediaObject *_self;
  1541.     PyObject *_args;
  1542. {
  1543.     PyObject *_res = NULL;
  1544.     OSType mediaType;
  1545.     Str255 creatorName;
  1546.     OSType creatorManufacturer;
  1547.     if (!PyArg_ParseTuple(_args, "O&",
  1548.                           PyMac_GetStr255, creatorName))
  1549.         return NULL;
  1550.     GetMediaHandlerDescription(_self->ob_itself,
  1551.                                &mediaType,
  1552.                                creatorName,
  1553.                                &creatorManufacturer);
  1554.     _res = Py_BuildValue("O&O&",
  1555.                          PyMac_BuildOSType, mediaType,
  1556.                          PyMac_BuildOSType, creatorManufacturer);
  1557.     return _res;
  1558. }
  1559.  
  1560. static PyObject *MediaObj_GetMediaUserData(_self, _args)
  1561.     MediaObject *_self;
  1562.     PyObject *_args;
  1563. {
  1564.     PyObject *_res = NULL;
  1565.     UserData _rv;
  1566.     if (!PyArg_ParseTuple(_args, ""))
  1567.         return NULL;
  1568.     _rv = GetMediaUserData(_self->ob_itself);
  1569.     _res = Py_BuildValue("O&",
  1570.                          UserDataObj_New, _rv);
  1571.     return _res;
  1572. }
  1573.  
  1574. static PyObject *MediaObj_GetMediaHandler(_self, _args)
  1575.     MediaObject *_self;
  1576.     PyObject *_args;
  1577. {
  1578.     PyObject *_res = NULL;
  1579.     MediaHandler _rv;
  1580.     if (!PyArg_ParseTuple(_args, ""))
  1581.         return NULL;
  1582.     _rv = GetMediaHandler(_self->ob_itself);
  1583.     _res = Py_BuildValue("O&",
  1584.                          CmpInstObj_New, _rv);
  1585.     return _res;
  1586. }
  1587.  
  1588. static PyObject *MediaObj_SetMediaHandler(_self, _args)
  1589.     MediaObject *_self;
  1590.     PyObject *_args;
  1591. {
  1592.     PyObject *_res = NULL;
  1593.     OSErr _err;
  1594.     MediaHandlerComponent mH;
  1595.     if (!PyArg_ParseTuple(_args, "O&",
  1596.                           CmpObj_Convert, &mH))
  1597.         return NULL;
  1598.     _err = SetMediaHandler(_self->ob_itself,
  1599.                            mH);
  1600.     if (_err != noErr) return PyMac_Error(_err);
  1601.     Py_INCREF(Py_None);
  1602.     _res = Py_None;
  1603.     return _res;
  1604. }
  1605.  
  1606. static PyObject *MediaObj_BeginMediaEdits(_self, _args)
  1607.     MediaObject *_self;
  1608.     PyObject *_args;
  1609. {
  1610.     PyObject *_res = NULL;
  1611.     OSErr _err;
  1612.     if (!PyArg_ParseTuple(_args, ""))
  1613.         return NULL;
  1614.     _err = BeginMediaEdits(_self->ob_itself);
  1615.     if (_err != noErr) return PyMac_Error(_err);
  1616.     Py_INCREF(Py_None);
  1617.     _res = Py_None;
  1618.     return _res;
  1619. }
  1620.  
  1621. static PyObject *MediaObj_EndMediaEdits(_self, _args)
  1622.     MediaObject *_self;
  1623.     PyObject *_args;
  1624. {
  1625.     PyObject *_res = NULL;
  1626.     OSErr _err;
  1627.     if (!PyArg_ParseTuple(_args, ""))
  1628.         return NULL;
  1629.     _err = EndMediaEdits(_self->ob_itself);
  1630.     if (_err != noErr) return PyMac_Error(_err);
  1631.     Py_INCREF(Py_None);
  1632.     _res = Py_None;
  1633.     return _res;
  1634. }
  1635.  
  1636. static PyObject *MediaObj_SetMediaDefaultDataRefIndex(_self, _args)
  1637.     MediaObject *_self;
  1638.     PyObject *_args;
  1639. {
  1640.     PyObject *_res = NULL;
  1641.     OSErr _err;
  1642.     short index;
  1643.     if (!PyArg_ParseTuple(_args, "h",
  1644.                           &index))
  1645.         return NULL;
  1646.     _err = SetMediaDefaultDataRefIndex(_self->ob_itself,
  1647.                                        index);
  1648.     if (_err != noErr) return PyMac_Error(_err);
  1649.     Py_INCREF(Py_None);
  1650.     _res = Py_None;
  1651.     return _res;
  1652. }
  1653.  
  1654. static PyObject *MediaObj_GetMediaDataHandlerDescription(_self, _args)
  1655.     MediaObject *_self;
  1656.     PyObject *_args;
  1657. {
  1658.     PyObject *_res = NULL;
  1659.     short index;
  1660.     OSType dhType;
  1661.     Str255 creatorName;
  1662.     OSType creatorManufacturer;
  1663.     if (!PyArg_ParseTuple(_args, "hO&",
  1664.                           &index,
  1665.                           PyMac_GetStr255, creatorName))
  1666.         return NULL;
  1667.     GetMediaDataHandlerDescription(_self->ob_itself,
  1668.                                    index,
  1669.                                    &dhType,
  1670.                                    creatorName,
  1671.                                    &creatorManufacturer);
  1672.     _res = Py_BuildValue("O&O&",
  1673.                          PyMac_BuildOSType, dhType,
  1674.                          PyMac_BuildOSType, creatorManufacturer);
  1675.     return _res;
  1676. }
  1677.  
  1678. static PyObject *MediaObj_GetMediaDataHandler(_self, _args)
  1679.     MediaObject *_self;
  1680.     PyObject *_args;
  1681. {
  1682.     PyObject *_res = NULL;
  1683.     DataHandler _rv;
  1684.     short index;
  1685.     if (!PyArg_ParseTuple(_args, "h",
  1686.                           &index))
  1687.         return NULL;
  1688.     _rv = GetMediaDataHandler(_self->ob_itself,
  1689.                               index);
  1690.     _res = Py_BuildValue("O&",
  1691.                          CmpInstObj_New, _rv);
  1692.     return _res;
  1693. }
  1694.  
  1695. static PyObject *MediaObj_SetMediaDataHandler(_self, _args)
  1696.     MediaObject *_self;
  1697.     PyObject *_args;
  1698. {
  1699.     PyObject *_res = NULL;
  1700.     OSErr _err;
  1701.     short index;
  1702.     DataHandlerComponent dataHandler;
  1703.     if (!PyArg_ParseTuple(_args, "hO&",
  1704.                           &index,
  1705.                           CmpObj_Convert, &dataHandler))
  1706.         return NULL;
  1707.     _err = SetMediaDataHandler(_self->ob_itself,
  1708.                                index,
  1709.                                dataHandler);
  1710.     if (_err != noErr) return PyMac_Error(_err);
  1711.     Py_INCREF(Py_None);
  1712.     _res = Py_None;
  1713.     return _res;
  1714. }
  1715.  
  1716. static PyObject *MediaObj_GetMediaSampleDescriptionCount(_self, _args)
  1717.     MediaObject *_self;
  1718.     PyObject *_args;
  1719. {
  1720.     PyObject *_res = NULL;
  1721.     long _rv;
  1722.     if (!PyArg_ParseTuple(_args, ""))
  1723.         return NULL;
  1724.     _rv = GetMediaSampleDescriptionCount(_self->ob_itself);
  1725.     _res = Py_BuildValue("l",
  1726.                          _rv);
  1727.     return _res;
  1728. }
  1729.  
  1730. static PyObject *MediaObj_GetMediaSampleDescription(_self, _args)
  1731.     MediaObject *_self;
  1732.     PyObject *_args;
  1733. {
  1734.     PyObject *_res = NULL;
  1735.     long index;
  1736.     SampleDescriptionHandle descH;
  1737.     if (!PyArg_ParseTuple(_args, "lO&",
  1738.                           &index,
  1739.                           ResObj_Convert, &descH))
  1740.         return NULL;
  1741.     GetMediaSampleDescription(_self->ob_itself,
  1742.                               index,
  1743.                               descH);
  1744.     Py_INCREF(Py_None);
  1745.     _res = Py_None;
  1746.     return _res;
  1747. }
  1748.  
  1749. static PyObject *MediaObj_SetMediaSampleDescription(_self, _args)
  1750.     MediaObject *_self;
  1751.     PyObject *_args;
  1752. {
  1753.     PyObject *_res = NULL;
  1754.     OSErr _err;
  1755.     long index;
  1756.     SampleDescriptionHandle descH;
  1757.     if (!PyArg_ParseTuple(_args, "lO&",
  1758.                           &index,
  1759.                           ResObj_Convert, &descH))
  1760.         return NULL;
  1761.     _err = SetMediaSampleDescription(_self->ob_itself,
  1762.                                      index,
  1763.                                      descH);
  1764.     if (_err != noErr) return PyMac_Error(_err);
  1765.     Py_INCREF(Py_None);
  1766.     _res = Py_None;
  1767.     return _res;
  1768. }
  1769.  
  1770. static PyObject *MediaObj_GetMediaSampleCount(_self, _args)
  1771.     MediaObject *_self;
  1772.     PyObject *_args;
  1773. {
  1774.     PyObject *_res = NULL;
  1775.     long _rv;
  1776.     if (!PyArg_ParseTuple(_args, ""))
  1777.         return NULL;
  1778.     _rv = GetMediaSampleCount(_self->ob_itself);
  1779.     _res = Py_BuildValue("l",
  1780.                          _rv);
  1781.     return _res;
  1782. }
  1783.  
  1784. static PyObject *MediaObj_SampleNumToMediaTime(_self, _args)
  1785.     MediaObject *_self;
  1786.     PyObject *_args;
  1787. {
  1788.     PyObject *_res = NULL;
  1789.     long logicalSampleNum;
  1790.     TimeValue sampleTime;
  1791.     TimeValue sampleDuration;
  1792.     if (!PyArg_ParseTuple(_args, "l",
  1793.                           &logicalSampleNum))
  1794.         return NULL;
  1795.     SampleNumToMediaTime(_self->ob_itself,
  1796.                          logicalSampleNum,
  1797.                          &sampleTime,
  1798.                          &sampleDuration);
  1799.     _res = Py_BuildValue("ll",
  1800.                          sampleTime,
  1801.                          sampleDuration);
  1802.     return _res;
  1803. }
  1804.  
  1805. static PyObject *MediaObj_MediaTimeToSampleNum(_self, _args)
  1806.     MediaObject *_self;
  1807.     PyObject *_args;
  1808. {
  1809.     PyObject *_res = NULL;
  1810.     TimeValue time;
  1811.     long sampleNum;
  1812.     TimeValue sampleTime;
  1813.     TimeValue sampleDuration;
  1814.     if (!PyArg_ParseTuple(_args, "l",
  1815.                           &time))
  1816.         return NULL;
  1817.     MediaTimeToSampleNum(_self->ob_itself,
  1818.                          time,
  1819.                          &sampleNum,
  1820.                          &sampleTime,
  1821.                          &sampleDuration);
  1822.     _res = Py_BuildValue("lll",
  1823.                          sampleNum,
  1824.                          sampleTime,
  1825.                          sampleDuration);
  1826.     return _res;
  1827. }
  1828.  
  1829. static PyObject *MediaObj_AddMediaSample(_self, _args)
  1830.     MediaObject *_self;
  1831.     PyObject *_args;
  1832. {
  1833.     PyObject *_res = NULL;
  1834.     OSErr _err;
  1835.     Handle dataIn;
  1836.     long inOffset;
  1837.     unsigned long size;
  1838.     TimeValue durationPerSample;
  1839.     SampleDescriptionHandle sampleDescriptionH;
  1840.     long numberOfSamples;
  1841.     short sampleFlags;
  1842.     TimeValue sampleTime;
  1843.     if (!PyArg_ParseTuple(_args, "O&lllO&lh",
  1844.                           ResObj_Convert, &dataIn,
  1845.                           &inOffset,
  1846.                           &size,
  1847.                           &durationPerSample,
  1848.                           ResObj_Convert, &sampleDescriptionH,
  1849.                           &numberOfSamples,
  1850.                           &sampleFlags))
  1851.         return NULL;
  1852.     _err = AddMediaSample(_self->ob_itself,
  1853.                           dataIn,
  1854.                           inOffset,
  1855.                           size,
  1856.                           durationPerSample,
  1857.                           sampleDescriptionH,
  1858.                           numberOfSamples,
  1859.                           sampleFlags,
  1860.                           &sampleTime);
  1861.     if (_err != noErr) return PyMac_Error(_err);
  1862.     _res = Py_BuildValue("l",
  1863.                          sampleTime);
  1864.     return _res;
  1865. }
  1866.  
  1867. static PyObject *MediaObj_AddMediaSampleReference(_self, _args)
  1868.     MediaObject *_self;
  1869.     PyObject *_args;
  1870. {
  1871.     PyObject *_res = NULL;
  1872.     OSErr _err;
  1873.     long dataOffset;
  1874.     unsigned long size;
  1875.     TimeValue durationPerSample;
  1876.     SampleDescriptionHandle sampleDescriptionH;
  1877.     long numberOfSamples;
  1878.     short sampleFlags;
  1879.     TimeValue sampleTime;
  1880.     if (!PyArg_ParseTuple(_args, "lllO&lh",
  1881.                           &dataOffset,
  1882.                           &size,
  1883.                           &durationPerSample,
  1884.                           ResObj_Convert, &sampleDescriptionH,
  1885.                           &numberOfSamples,
  1886.                           &sampleFlags))
  1887.         return NULL;
  1888.     _err = AddMediaSampleReference(_self->ob_itself,
  1889.                                    dataOffset,
  1890.                                    size,
  1891.                                    durationPerSample,
  1892.                                    sampleDescriptionH,
  1893.                                    numberOfSamples,
  1894.                                    sampleFlags,
  1895.                                    &sampleTime);
  1896.     if (_err != noErr) return PyMac_Error(_err);
  1897.     _res = Py_BuildValue("l",
  1898.                          sampleTime);
  1899.     return _res;
  1900. }
  1901.  
  1902. static PyObject *MediaObj_GetMediaSample(_self, _args)
  1903.     MediaObject *_self;
  1904.     PyObject *_args;
  1905. {
  1906.     PyObject *_res = NULL;
  1907.     OSErr _err;
  1908.     Handle dataOut;
  1909.     long maxSizeToGrow;
  1910.     long size;
  1911.     TimeValue time;
  1912.     TimeValue sampleTime;
  1913.     TimeValue durationPerSample;
  1914.     SampleDescriptionHandle sampleDescriptionH;
  1915.     long sampleDescriptionIndex;
  1916.     long maxNumberOfSamples;
  1917.     long numberOfSamples;
  1918.     short sampleFlags;
  1919.     if (!PyArg_ParseTuple(_args, "O&llO&l",
  1920.                           ResObj_Convert, &dataOut,
  1921.                           &maxSizeToGrow,
  1922.                           &time,
  1923.                           ResObj_Convert, &sampleDescriptionH,
  1924.                           &maxNumberOfSamples))
  1925.         return NULL;
  1926.     _err = GetMediaSample(_self->ob_itself,
  1927.                           dataOut,
  1928.                           maxSizeToGrow,
  1929.                           &size,
  1930.                           time,
  1931.                           &sampleTime,
  1932.                           &durationPerSample,
  1933.                           sampleDescriptionH,
  1934.                           &sampleDescriptionIndex,
  1935.                           maxNumberOfSamples,
  1936.                           &numberOfSamples,
  1937.                           &sampleFlags);
  1938.     if (_err != noErr) return PyMac_Error(_err);
  1939.     _res = Py_BuildValue("lllllh",
  1940.                          size,
  1941.                          sampleTime,
  1942.                          durationPerSample,
  1943.                          sampleDescriptionIndex,
  1944.                          numberOfSamples,
  1945.                          sampleFlags);
  1946.     return _res;
  1947. }
  1948.  
  1949. static PyObject *MediaObj_GetMediaSampleReference(_self, _args)
  1950.     MediaObject *_self;
  1951.     PyObject *_args;
  1952. {
  1953.     PyObject *_res = NULL;
  1954.     OSErr _err;
  1955.     long dataOffset;
  1956.     long size;
  1957.     TimeValue time;
  1958.     TimeValue sampleTime;
  1959.     TimeValue durationPerSample;
  1960.     SampleDescriptionHandle sampleDescriptionH;
  1961.     long sampleDescriptionIndex;
  1962.     long maxNumberOfSamples;
  1963.     long numberOfSamples;
  1964.     short sampleFlags;
  1965.     if (!PyArg_ParseTuple(_args, "lO&l",
  1966.                           &time,
  1967.                           ResObj_Convert, &sampleDescriptionH,
  1968.                           &maxNumberOfSamples))
  1969.         return NULL;
  1970.     _err = GetMediaSampleReference(_self->ob_itself,
  1971.                                    &dataOffset,
  1972.                                    &size,
  1973.                                    time,
  1974.                                    &sampleTime,
  1975.                                    &durationPerSample,
  1976.                                    sampleDescriptionH,
  1977.                                    &sampleDescriptionIndex,
  1978.                                    maxNumberOfSamples,
  1979.                                    &numberOfSamples,
  1980.                                    &sampleFlags);
  1981.     if (_err != noErr) return PyMac_Error(_err);
  1982.     _res = Py_BuildValue("llllllh",
  1983.                          dataOffset,
  1984.                          size,
  1985.                          sampleTime,
  1986.                          durationPerSample,
  1987.                          sampleDescriptionIndex,
  1988.                          numberOfSamples,
  1989.                          sampleFlags);
  1990.     return _res;
  1991. }
  1992.  
  1993. static PyObject *MediaObj_SetMediaPreferredChunkSize(_self, _args)
  1994.     MediaObject *_self;
  1995.     PyObject *_args;
  1996. {
  1997.     PyObject *_res = NULL;
  1998.     OSErr _err;
  1999.     long maxChunkSize;
  2000.     if (!PyArg_ParseTuple(_args, "l",
  2001.                           &maxChunkSize))
  2002.         return NULL;
  2003.     _err = SetMediaPreferredChunkSize(_self->ob_itself,
  2004.                                       maxChunkSize);
  2005.     if (_err != noErr) return PyMac_Error(_err);
  2006.     Py_INCREF(Py_None);
  2007.     _res = Py_None;
  2008.     return _res;
  2009. }
  2010.  
  2011. static PyObject *MediaObj_GetMediaPreferredChunkSize(_self, _args)
  2012.     MediaObject *_self;
  2013.     PyObject *_args;
  2014. {
  2015.     PyObject *_res = NULL;
  2016.     OSErr _err;
  2017.     long maxChunkSize;
  2018.     if (!PyArg_ParseTuple(_args, ""))
  2019.         return NULL;
  2020.     _err = GetMediaPreferredChunkSize(_self->ob_itself,
  2021.                                       &maxChunkSize);
  2022.     if (_err != noErr) return PyMac_Error(_err);
  2023.     _res = Py_BuildValue("l",
  2024.                          maxChunkSize);
  2025.     return _res;
  2026. }
  2027.  
  2028. static PyObject *MediaObj_SetMediaShadowSync(_self, _args)
  2029.     MediaObject *_self;
  2030.     PyObject *_args;
  2031. {
  2032.     PyObject *_res = NULL;
  2033.     OSErr _err;
  2034.     long frameDiffSampleNum;
  2035.     long syncSampleNum;
  2036.     if (!PyArg_ParseTuple(_args, "ll",
  2037.                           &frameDiffSampleNum,
  2038.                           &syncSampleNum))
  2039.         return NULL;
  2040.     _err = SetMediaShadowSync(_self->ob_itself,
  2041.                               frameDiffSampleNum,
  2042.                               syncSampleNum);
  2043.     if (_err != noErr) return PyMac_Error(_err);
  2044.     Py_INCREF(Py_None);
  2045.     _res = Py_None;
  2046.     return _res;
  2047. }
  2048.  
  2049. static PyObject *MediaObj_GetMediaShadowSync(_self, _args)
  2050.     MediaObject *_self;
  2051.     PyObject *_args;
  2052. {
  2053.     PyObject *_res = NULL;
  2054.     OSErr _err;
  2055.     long frameDiffSampleNum;
  2056.     long syncSampleNum;
  2057.     if (!PyArg_ParseTuple(_args, "l",
  2058.                           &frameDiffSampleNum))
  2059.         return NULL;
  2060.     _err = GetMediaShadowSync(_self->ob_itself,
  2061.                               frameDiffSampleNum,
  2062.                               &syncSampleNum);
  2063.     if (_err != noErr) return PyMac_Error(_err);
  2064.     _res = Py_BuildValue("l",
  2065.                          syncSampleNum);
  2066.     return _res;
  2067. }
  2068.  
  2069. static PyObject *MediaObj_GetMediaDataSize(_self, _args)
  2070.     MediaObject *_self;
  2071.     PyObject *_args;
  2072. {
  2073.     PyObject *_res = NULL;
  2074.     long _rv;
  2075.     TimeValue startTime;
  2076.     TimeValue duration;
  2077.     if (!PyArg_ParseTuple(_args, "ll",
  2078.                           &startTime,
  2079.                           &duration))
  2080.         return NULL;
  2081.     _rv = GetMediaDataSize(_self->ob_itself,
  2082.                            startTime,
  2083.                            duration);
  2084.     _res = Py_BuildValue("l",
  2085.                          _rv);
  2086.     return _res;
  2087. }
  2088.  
  2089. static PyObject *MediaObj_GetMediaNextInterestingTime(_self, _args)
  2090.     MediaObject *_self;
  2091.     PyObject *_args;
  2092. {
  2093.     PyObject *_res = NULL;
  2094.     short interestingTimeFlags;
  2095.     TimeValue time;
  2096.     Fixed rate;
  2097.     TimeValue interestingTime;
  2098.     TimeValue interestingDuration;
  2099.     if (!PyArg_ParseTuple(_args, "hlO&",
  2100.                           &interestingTimeFlags,
  2101.                           &time,
  2102.                           PyMac_GetFixed, &rate))
  2103.         return NULL;
  2104.     GetMediaNextInterestingTime(_self->ob_itself,
  2105.                                 interestingTimeFlags,
  2106.                                 time,
  2107.                                 rate,
  2108.                                 &interestingTime,
  2109.                                 &interestingDuration);
  2110.     _res = Py_BuildValue("ll",
  2111.                          interestingTime,
  2112.                          interestingDuration);
  2113.     return _res;
  2114. }
  2115.  
  2116. static PyObject *MediaObj_GetMediaDataRef(_self, _args)
  2117.     MediaObject *_self;
  2118.     PyObject *_args;
  2119. {
  2120.     PyObject *_res = NULL;
  2121.     OSErr _err;
  2122.     short index;
  2123.     Handle dataRef;
  2124.     OSType dataRefType;
  2125.     long dataRefAttributes;
  2126.     if (!PyArg_ParseTuple(_args, "h",
  2127.                           &index))
  2128.         return NULL;
  2129.     _err = GetMediaDataRef(_self->ob_itself,
  2130.                            index,
  2131.                            &dataRef,
  2132.                            &dataRefType,
  2133.                            &dataRefAttributes);
  2134.     if (_err != noErr) return PyMac_Error(_err);
  2135.     _res = Py_BuildValue("O&O&l",
  2136.                          ResObj_New, dataRef,
  2137.                          PyMac_BuildOSType, dataRefType,
  2138.                          dataRefAttributes);
  2139.     return _res;
  2140. }
  2141.  
  2142. static PyObject *MediaObj_SetMediaDataRef(_self, _args)
  2143.     MediaObject *_self;
  2144.     PyObject *_args;
  2145. {
  2146.     PyObject *_res = NULL;
  2147.     OSErr _err;
  2148.     short index;
  2149.     Handle dataRef;
  2150.     OSType dataRefType;
  2151.     if (!PyArg_ParseTuple(_args, "hO&O&",
  2152.                           &index,
  2153.                           ResObj_Convert, &dataRef,
  2154.                           PyMac_GetOSType, &dataRefType))
  2155.         return NULL;
  2156.     _err = SetMediaDataRef(_self->ob_itself,
  2157.                            index,
  2158.                            dataRef,
  2159.                            dataRefType);
  2160.     if (_err != noErr) return PyMac_Error(_err);
  2161.     Py_INCREF(Py_None);
  2162.     _res = Py_None;
  2163.     return _res;
  2164. }
  2165.  
  2166. static PyObject *MediaObj_SetMediaDataRefAttributes(_self, _args)
  2167.     MediaObject *_self;
  2168.     PyObject *_args;
  2169. {
  2170.     PyObject *_res = NULL;
  2171.     OSErr _err;
  2172.     short index;
  2173.     long dataRefAttributes;
  2174.     if (!PyArg_ParseTuple(_args, "hl",
  2175.                           &index,
  2176.                           &dataRefAttributes))
  2177.         return NULL;
  2178.     _err = SetMediaDataRefAttributes(_self->ob_itself,
  2179.                                      index,
  2180.                                      dataRefAttributes);
  2181.     if (_err != noErr) return PyMac_Error(_err);
  2182.     Py_INCREF(Py_None);
  2183.     _res = Py_None;
  2184.     return _res;
  2185. }
  2186.  
  2187. static PyObject *MediaObj_AddMediaDataRef(_self, _args)
  2188.     MediaObject *_self;
  2189.     PyObject *_args;
  2190. {
  2191.     PyObject *_res = NULL;
  2192.     OSErr _err;
  2193.     short index;
  2194.     Handle dataRef;
  2195.     OSType dataRefType;
  2196.     if (!PyArg_ParseTuple(_args, "O&O&",
  2197.                           ResObj_Convert, &dataRef,
  2198.                           PyMac_GetOSType, &dataRefType))
  2199.         return NULL;
  2200.     _err = AddMediaDataRef(_self->ob_itself,
  2201.                            &index,
  2202.                            dataRef,
  2203.                            dataRefType);
  2204.     if (_err != noErr) return PyMac_Error(_err);
  2205.     _res = Py_BuildValue("h",
  2206.                          index);
  2207.     return _res;
  2208. }
  2209.  
  2210. static PyObject *MediaObj_GetMediaDataRefCount(_self, _args)
  2211.     MediaObject *_self;
  2212.     PyObject *_args;
  2213. {
  2214.     PyObject *_res = NULL;
  2215.     OSErr _err;
  2216.     short count;
  2217.     if (!PyArg_ParseTuple(_args, ""))
  2218.         return NULL;
  2219.     _err = GetMediaDataRefCount(_self->ob_itself,
  2220.                                 &count);
  2221.     if (_err != noErr) return PyMac_Error(_err);
  2222.     _res = Py_BuildValue("h",
  2223.                          count);
  2224.     return _res;
  2225. }
  2226.  
  2227. static PyObject *MediaObj_SetMediaPlayHints(_self, _args)
  2228.     MediaObject *_self;
  2229.     PyObject *_args;
  2230. {
  2231.     PyObject *_res = NULL;
  2232.     long flags;
  2233.     long flagsMask;
  2234.     if (!PyArg_ParseTuple(_args, "ll",
  2235.                           &flags,
  2236.                           &flagsMask))
  2237.         return NULL;
  2238.     SetMediaPlayHints(_self->ob_itself,
  2239.                       flags,
  2240.                       flagsMask);
  2241.     Py_INCREF(Py_None);
  2242.     _res = Py_None;
  2243.     return _res;
  2244. }
  2245.  
  2246. static PyMethodDef MediaObj_methods[] = {
  2247.     {"LoadMediaIntoRam", (PyCFunction)MediaObj_LoadMediaIntoRam, 1,
  2248.      "(TimeValue time, TimeValue duration, long flags) -> None"},
  2249.     {"GetMediaTrack", (PyCFunction)MediaObj_GetMediaTrack, 1,
  2250.      "() -> (Track _rv)"},
  2251.     {"GetMediaTimeScale", (PyCFunction)MediaObj_GetMediaTimeScale, 1,
  2252.      "() -> (TimeScale _rv)"},
  2253.     {"SetMediaTimeScale", (PyCFunction)MediaObj_SetMediaTimeScale, 1,
  2254.      "(TimeScale timeScale) -> None"},
  2255.     {"GetMediaDuration", (PyCFunction)MediaObj_GetMediaDuration, 1,
  2256.      "() -> (TimeValue _rv)"},
  2257.     {"GetMediaLanguage", (PyCFunction)MediaObj_GetMediaLanguage, 1,
  2258.      "() -> (short _rv)"},
  2259.     {"SetMediaLanguage", (PyCFunction)MediaObj_SetMediaLanguage, 1,
  2260.      "(short language) -> None"},
  2261.     {"GetMediaQuality", (PyCFunction)MediaObj_GetMediaQuality, 1,
  2262.      "() -> (short _rv)"},
  2263.     {"SetMediaQuality", (PyCFunction)MediaObj_SetMediaQuality, 1,
  2264.      "(short quality) -> None"},
  2265.     {"GetMediaHandlerDescription", (PyCFunction)MediaObj_GetMediaHandlerDescription, 1,
  2266.      "(Str255 creatorName) -> (OSType mediaType, OSType creatorManufacturer)"},
  2267.     {"GetMediaUserData", (PyCFunction)MediaObj_GetMediaUserData, 1,
  2268.      "() -> (UserData _rv)"},
  2269.     {"GetMediaHandler", (PyCFunction)MediaObj_GetMediaHandler, 1,
  2270.      "() -> (MediaHandler _rv)"},
  2271.     {"SetMediaHandler", (PyCFunction)MediaObj_SetMediaHandler, 1,
  2272.      "(MediaHandlerComponent mH) -> None"},
  2273.     {"BeginMediaEdits", (PyCFunction)MediaObj_BeginMediaEdits, 1,
  2274.      "() -> None"},
  2275.     {"EndMediaEdits", (PyCFunction)MediaObj_EndMediaEdits, 1,
  2276.      "() -> None"},
  2277.     {"SetMediaDefaultDataRefIndex", (PyCFunction)MediaObj_SetMediaDefaultDataRefIndex, 1,
  2278.      "(short index) -> None"},
  2279.     {"GetMediaDataHandlerDescription", (PyCFunction)MediaObj_GetMediaDataHandlerDescription, 1,
  2280.      "(short index, Str255 creatorName) -> (OSType dhType, OSType creatorManufacturer)"},
  2281.     {"GetMediaDataHandler", (PyCFunction)MediaObj_GetMediaDataHandler, 1,
  2282.      "(short index) -> (DataHandler _rv)"},
  2283.     {"SetMediaDataHandler", (PyCFunction)MediaObj_SetMediaDataHandler, 1,
  2284.      "(short index, DataHandlerComponent dataHandler) -> None"},
  2285.     {"GetMediaSampleDescriptionCount", (PyCFunction)MediaObj_GetMediaSampleDescriptionCount, 1,
  2286.      "() -> (long _rv)"},
  2287.     {"GetMediaSampleDescription", (PyCFunction)MediaObj_GetMediaSampleDescription, 1,
  2288.      "(long index, SampleDescriptionHandle descH) -> None"},
  2289.     {"SetMediaSampleDescription", (PyCFunction)MediaObj_SetMediaSampleDescription, 1,
  2290.      "(long index, SampleDescriptionHandle descH) -> None"},
  2291.     {"GetMediaSampleCount", (PyCFunction)MediaObj_GetMediaSampleCount, 1,
  2292.      "() -> (long _rv)"},
  2293.     {"SampleNumToMediaTime", (PyCFunction)MediaObj_SampleNumToMediaTime, 1,
  2294.      "(long logicalSampleNum) -> (TimeValue sampleTime, TimeValue sampleDuration)"},
  2295.     {"MediaTimeToSampleNum", (PyCFunction)MediaObj_MediaTimeToSampleNum, 1,
  2296.      "(TimeValue time) -> (long sampleNum, TimeValue sampleTime, TimeValue sampleDuration)"},
  2297.     {"AddMediaSample", (PyCFunction)MediaObj_AddMediaSample, 1,
  2298.      "(Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
  2299.     {"AddMediaSampleReference", (PyCFunction)MediaObj_AddMediaSampleReference, 1,
  2300.      "(long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags) -> (TimeValue sampleTime)"},
  2301.     {"GetMediaSample", (PyCFunction)MediaObj_GetMediaSample, 1,
  2302.      "(Handle dataOut, long maxSizeToGrow, TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
  2303.     {"GetMediaSampleReference", (PyCFunction)MediaObj_GetMediaSampleReference, 1,
  2304.      "(TimeValue time, SampleDescriptionHandle sampleDescriptionH, long maxNumberOfSamples) -> (long dataOffset, long size, TimeValue sampleTime, TimeValue durationPerSample, long sampleDescriptionIndex, long numberOfSamples, short sampleFlags)"},
  2305.     {"SetMediaPreferredChunkSize", (PyCFunction)MediaObj_SetMediaPreferredChunkSize, 1,
  2306.      "(long maxChunkSize) -> None"},
  2307.     {"GetMediaPreferredChunkSize", (PyCFunction)MediaObj_GetMediaPreferredChunkSize, 1,
  2308.      "() -> (long maxChunkSize)"},
  2309.     {"SetMediaShadowSync", (PyCFunction)MediaObj_SetMediaShadowSync, 1,
  2310.      "(long frameDiffSampleNum, long syncSampleNum) -> None"},
  2311.     {"GetMediaShadowSync", (PyCFunction)MediaObj_GetMediaShadowSync, 1,
  2312.      "(long frameDiffSampleNum) -> (long syncSampleNum)"},
  2313.     {"GetMediaDataSize", (PyCFunction)MediaObj_GetMediaDataSize, 1,
  2314.      "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
  2315.     {"GetMediaNextInterestingTime", (PyCFunction)MediaObj_GetMediaNextInterestingTime, 1,
  2316.      "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
  2317.     {"GetMediaDataRef", (PyCFunction)MediaObj_GetMediaDataRef, 1,
  2318.      "(short index) -> (Handle dataRef, OSType dataRefType, long dataRefAttributes)"},
  2319.     {"SetMediaDataRef", (PyCFunction)MediaObj_SetMediaDataRef, 1,
  2320.      "(short index, Handle dataRef, OSType dataRefType) -> None"},
  2321.     {"SetMediaDataRefAttributes", (PyCFunction)MediaObj_SetMediaDataRefAttributes, 1,
  2322.      "(short index, long dataRefAttributes) -> None"},
  2323.     {"AddMediaDataRef", (PyCFunction)MediaObj_AddMediaDataRef, 1,
  2324.      "(Handle dataRef, OSType dataRefType) -> (short index)"},
  2325.     {"GetMediaDataRefCount", (PyCFunction)MediaObj_GetMediaDataRefCount, 1,
  2326.      "() -> (short count)"},
  2327.     {"SetMediaPlayHints", (PyCFunction)MediaObj_SetMediaPlayHints, 1,
  2328.      "(long flags, long flagsMask) -> None"},
  2329.     {NULL, NULL, 0}
  2330. };
  2331.  
  2332. PyMethodChain MediaObj_chain = { MediaObj_methods, NULL };
  2333.  
  2334. static PyObject *MediaObj_getattr(self, name)
  2335.     MediaObject *self;
  2336.     char *name;
  2337. {
  2338.     return Py_FindMethodInChain(&MediaObj_chain, (PyObject *)self, name);
  2339. }
  2340.  
  2341. #define MediaObj_setattr NULL
  2342.  
  2343. PyTypeObject Media_Type = {
  2344.     PyObject_HEAD_INIT(&PyType_Type)
  2345.     0, /*ob_size*/
  2346.     "Media", /*tp_name*/
  2347.     sizeof(MediaObject), /*tp_basicsize*/
  2348.     0, /*tp_itemsize*/
  2349.     /* methods */
  2350.     (destructor) MediaObj_dealloc, /*tp_dealloc*/
  2351.     0, /*tp_print*/
  2352.     (getattrfunc) MediaObj_getattr, /*tp_getattr*/
  2353.     (setattrfunc) MediaObj_setattr, /*tp_setattr*/
  2354. };
  2355.  
  2356. /* --------------------- End object type Media ---------------------- */
  2357.  
  2358.  
  2359. /* ----------------------- Object type Track ------------------------ */
  2360.  
  2361. PyTypeObject Track_Type;
  2362.  
  2363. #define TrackObj_Check(x) ((x)->ob_type == &Track_Type)
  2364.  
  2365. typedef struct TrackObject {
  2366.     PyObject_HEAD
  2367.     Track ob_itself;
  2368. } TrackObject;
  2369.  
  2370. PyObject *TrackObj_New(itself)
  2371.     Track itself;
  2372. {
  2373.     TrackObject *it;
  2374.     if (itself == NULL) {
  2375.                         PyErr_SetString(Qt_Error,"Cannot create null Track");
  2376.                         return NULL;
  2377.                     }
  2378.     it = PyObject_NEW(TrackObject, &Track_Type);
  2379.     if (it == NULL) return NULL;
  2380.     it->ob_itself = itself;
  2381.     return (PyObject *)it;
  2382. }
  2383. TrackObj_Convert(v, p_itself)
  2384.     PyObject *v;
  2385.     Track *p_itself;
  2386. {
  2387.     if (!TrackObj_Check(v))
  2388.     {
  2389.         PyErr_SetString(PyExc_TypeError, "Track required");
  2390.         return 0;
  2391.     }
  2392.     *p_itself = ((TrackObject *)v)->ob_itself;
  2393.     return 1;
  2394. }
  2395.  
  2396. static void TrackObj_dealloc(self)
  2397.     TrackObject *self;
  2398. {
  2399.     DisposeMovieTrack(self->ob_itself);
  2400.     PyMem_DEL(self);
  2401. }
  2402.  
  2403. static PyObject *TrackObj_LoadTrackIntoRam(_self, _args)
  2404.     TrackObject *_self;
  2405.     PyObject *_args;
  2406. {
  2407.     PyObject *_res = NULL;
  2408.     OSErr _err;
  2409.     TimeValue time;
  2410.     TimeValue duration;
  2411.     long flags;
  2412.     if (!PyArg_ParseTuple(_args, "lll",
  2413.                           &time,
  2414.                           &duration,
  2415.                           &flags))
  2416.         return NULL;
  2417.     _err = LoadTrackIntoRam(_self->ob_itself,
  2418.                             time,
  2419.                             duration,
  2420.                             flags);
  2421.     if (_err != noErr) return PyMac_Error(_err);
  2422.     Py_INCREF(Py_None);
  2423.     _res = Py_None;
  2424.     return _res;
  2425. }
  2426.  
  2427. static PyObject *TrackObj_GetTrackPict(_self, _args)
  2428.     TrackObject *_self;
  2429.     PyObject *_args;
  2430. {
  2431.     PyObject *_res = NULL;
  2432.     PicHandle _rv;
  2433.     TimeValue time;
  2434.     if (!PyArg_ParseTuple(_args, "l",
  2435.                           &time))
  2436.         return NULL;
  2437.     _rv = GetTrackPict(_self->ob_itself,
  2438.                        time);
  2439.     _res = Py_BuildValue("O&",
  2440.                          ResObj_New, _rv);
  2441.     return _res;
  2442. }
  2443.  
  2444. static PyObject *TrackObj_GetTrackClipRgn(_self, _args)
  2445.     TrackObject *_self;
  2446.     PyObject *_args;
  2447. {
  2448.     PyObject *_res = NULL;
  2449.     RgnHandle _rv;
  2450.     if (!PyArg_ParseTuple(_args, ""))
  2451.         return NULL;
  2452.     _rv = GetTrackClipRgn(_self->ob_itself);
  2453.     _res = Py_BuildValue("O&",
  2454.                          ResObj_New, _rv);
  2455.     return _res;
  2456. }
  2457.  
  2458. static PyObject *TrackObj_SetTrackClipRgn(_self, _args)
  2459.     TrackObject *_self;
  2460.     PyObject *_args;
  2461. {
  2462.     PyObject *_res = NULL;
  2463.     RgnHandle theClip;
  2464.     if (!PyArg_ParseTuple(_args, "O&",
  2465.                           ResObj_Convert, &theClip))
  2466.         return NULL;
  2467.     SetTrackClipRgn(_self->ob_itself,
  2468.                     theClip);
  2469.     Py_INCREF(Py_None);
  2470.     _res = Py_None;
  2471.     return _res;
  2472. }
  2473.  
  2474. static PyObject *TrackObj_GetTrackDisplayBoundsRgn(_self, _args)
  2475.     TrackObject *_self;
  2476.     PyObject *_args;
  2477. {
  2478.     PyObject *_res = NULL;
  2479.     RgnHandle _rv;
  2480.     if (!PyArg_ParseTuple(_args, ""))
  2481.         return NULL;
  2482.     _rv = GetTrackDisplayBoundsRgn(_self->ob_itself);
  2483.     _res = Py_BuildValue("O&",
  2484.                          ResObj_New, _rv);
  2485.     return _res;
  2486. }
  2487.  
  2488. static PyObject *TrackObj_GetTrackMovieBoundsRgn(_self, _args)
  2489.     TrackObject *_self;
  2490.     PyObject *_args;
  2491. {
  2492.     PyObject *_res = NULL;
  2493.     RgnHandle _rv;
  2494.     if (!PyArg_ParseTuple(_args, ""))
  2495.         return NULL;
  2496.     _rv = GetTrackMovieBoundsRgn(_self->ob_itself);
  2497.     _res = Py_BuildValue("O&",
  2498.                          ResObj_New, _rv);
  2499.     return _res;
  2500. }
  2501.  
  2502. static PyObject *TrackObj_GetTrackBoundsRgn(_self, _args)
  2503.     TrackObject *_self;
  2504.     PyObject *_args;
  2505. {
  2506.     PyObject *_res = NULL;
  2507.     RgnHandle _rv;
  2508.     if (!PyArg_ParseTuple(_args, ""))
  2509.         return NULL;
  2510.     _rv = GetTrackBoundsRgn(_self->ob_itself);
  2511.     _res = Py_BuildValue("O&",
  2512.                          ResObj_New, _rv);
  2513.     return _res;
  2514. }
  2515.  
  2516. static PyObject *TrackObj_GetTrackMatte(_self, _args)
  2517.     TrackObject *_self;
  2518.     PyObject *_args;
  2519. {
  2520.     PyObject *_res = NULL;
  2521.     PixMapHandle _rv;
  2522.     if (!PyArg_ParseTuple(_args, ""))
  2523.         return NULL;
  2524.     _rv = GetTrackMatte(_self->ob_itself);
  2525.     _res = Py_BuildValue("O&",
  2526.                          ResObj_New, _rv);
  2527.     return _res;
  2528. }
  2529.  
  2530. static PyObject *TrackObj_SetTrackMatte(_self, _args)
  2531.     TrackObject *_self;
  2532.     PyObject *_args;
  2533. {
  2534.     PyObject *_res = NULL;
  2535.     PixMapHandle theMatte;
  2536.     if (!PyArg_ParseTuple(_args, "O&",
  2537.                           ResObj_Convert, &theMatte))
  2538.         return NULL;
  2539.     SetTrackMatte(_self->ob_itself,
  2540.                   theMatte);
  2541.     Py_INCREF(Py_None);
  2542.     _res = Py_None;
  2543.     return _res;
  2544. }
  2545.  
  2546. static PyObject *TrackObj_GetTrackID(_self, _args)
  2547.     TrackObject *_self;
  2548.     PyObject *_args;
  2549. {
  2550.     PyObject *_res = NULL;
  2551.     long _rv;
  2552.     if (!PyArg_ParseTuple(_args, ""))
  2553.         return NULL;
  2554.     _rv = GetTrackID(_self->ob_itself);
  2555.     _res = Py_BuildValue("l",
  2556.                          _rv);
  2557.     return _res;
  2558. }
  2559.  
  2560. static PyObject *TrackObj_GetTrackMovie(_self, _args)
  2561.     TrackObject *_self;
  2562.     PyObject *_args;
  2563. {
  2564.     PyObject *_res = NULL;
  2565.     Movie _rv;
  2566.     if (!PyArg_ParseTuple(_args, ""))
  2567.         return NULL;
  2568.     _rv = GetTrackMovie(_self->ob_itself);
  2569.     _res = Py_BuildValue("O&",
  2570.                          MovieObj_New, _rv);
  2571.     return _res;
  2572. }
  2573.  
  2574. static PyObject *TrackObj_GetTrackEnabled(_self, _args)
  2575.     TrackObject *_self;
  2576.     PyObject *_args;
  2577. {
  2578.     PyObject *_res = NULL;
  2579.     Boolean _rv;
  2580.     if (!PyArg_ParseTuple(_args, ""))
  2581.         return NULL;
  2582.     _rv = GetTrackEnabled(_self->ob_itself);
  2583.     _res = Py_BuildValue("b",
  2584.                          _rv);
  2585.     return _res;
  2586. }
  2587.  
  2588. static PyObject *TrackObj_SetTrackEnabled(_self, _args)
  2589.     TrackObject *_self;
  2590.     PyObject *_args;
  2591. {
  2592.     PyObject *_res = NULL;
  2593.     Boolean isEnabled;
  2594.     if (!PyArg_ParseTuple(_args, "b",
  2595.                           &isEnabled))
  2596.         return NULL;
  2597.     SetTrackEnabled(_self->ob_itself,
  2598.                     isEnabled);
  2599.     Py_INCREF(Py_None);
  2600.     _res = Py_None;
  2601.     return _res;
  2602. }
  2603.  
  2604. static PyObject *TrackObj_GetTrackUsage(_self, _args)
  2605.     TrackObject *_self;
  2606.     PyObject *_args;
  2607. {
  2608.     PyObject *_res = NULL;
  2609.     long _rv;
  2610.     if (!PyArg_ParseTuple(_args, ""))
  2611.         return NULL;
  2612.     _rv = GetTrackUsage(_self->ob_itself);
  2613.     _res = Py_BuildValue("l",
  2614.                          _rv);
  2615.     return _res;
  2616. }
  2617.  
  2618. static PyObject *TrackObj_SetTrackUsage(_self, _args)
  2619.     TrackObject *_self;
  2620.     PyObject *_args;
  2621. {
  2622.     PyObject *_res = NULL;
  2623.     long usage;
  2624.     if (!PyArg_ParseTuple(_args, "l",
  2625.                           &usage))
  2626.         return NULL;
  2627.     SetTrackUsage(_self->ob_itself,
  2628.                   usage);
  2629.     Py_INCREF(Py_None);
  2630.     _res = Py_None;
  2631.     return _res;
  2632. }
  2633.  
  2634. static PyObject *TrackObj_GetTrackDuration(_self, _args)
  2635.     TrackObject *_self;
  2636.     PyObject *_args;
  2637. {
  2638.     PyObject *_res = NULL;
  2639.     TimeValue _rv;
  2640.     if (!PyArg_ParseTuple(_args, ""))
  2641.         return NULL;
  2642.     _rv = GetTrackDuration(_self->ob_itself);
  2643.     _res = Py_BuildValue("l",
  2644.                          _rv);
  2645.     return _res;
  2646. }
  2647.  
  2648. static PyObject *TrackObj_GetTrackOffset(_self, _args)
  2649.     TrackObject *_self;
  2650.     PyObject *_args;
  2651. {
  2652.     PyObject *_res = NULL;
  2653.     TimeValue _rv;
  2654.     if (!PyArg_ParseTuple(_args, ""))
  2655.         return NULL;
  2656.     _rv = GetTrackOffset(_self->ob_itself);
  2657.     _res = Py_BuildValue("l",
  2658.                          _rv);
  2659.     return _res;
  2660. }
  2661.  
  2662. static PyObject *TrackObj_SetTrackOffset(_self, _args)
  2663.     TrackObject *_self;
  2664.     PyObject *_args;
  2665. {
  2666.     PyObject *_res = NULL;
  2667.     TimeValue movieOffsetTime;
  2668.     if (!PyArg_ParseTuple(_args, "l",
  2669.                           &movieOffsetTime))
  2670.         return NULL;
  2671.     SetTrackOffset(_self->ob_itself,
  2672.                    movieOffsetTime);
  2673.     Py_INCREF(Py_None);
  2674.     _res = Py_None;
  2675.     return _res;
  2676. }
  2677.  
  2678. static PyObject *TrackObj_GetTrackLayer(_self, _args)
  2679.     TrackObject *_self;
  2680.     PyObject *_args;
  2681. {
  2682.     PyObject *_res = NULL;
  2683.     short _rv;
  2684.     if (!PyArg_ParseTuple(_args, ""))
  2685.         return NULL;
  2686.     _rv = GetTrackLayer(_self->ob_itself);
  2687.     _res = Py_BuildValue("h",
  2688.                          _rv);
  2689.     return _res;
  2690. }
  2691.  
  2692. static PyObject *TrackObj_SetTrackLayer(_self, _args)
  2693.     TrackObject *_self;
  2694.     PyObject *_args;
  2695. {
  2696.     PyObject *_res = NULL;
  2697.     short layer;
  2698.     if (!PyArg_ParseTuple(_args, "h",
  2699.                           &layer))
  2700.         return NULL;
  2701.     SetTrackLayer(_self->ob_itself,
  2702.                   layer);
  2703.     Py_INCREF(Py_None);
  2704.     _res = Py_None;
  2705.     return _res;
  2706. }
  2707.  
  2708. static PyObject *TrackObj_GetTrackAlternate(_self, _args)
  2709.     TrackObject *_self;
  2710.     PyObject *_args;
  2711. {
  2712.     PyObject *_res = NULL;
  2713.     Track _rv;
  2714.     if (!PyArg_ParseTuple(_args, ""))
  2715.         return NULL;
  2716.     _rv = GetTrackAlternate(_self->ob_itself);
  2717.     _res = Py_BuildValue("O&",
  2718.                          TrackObj_New, _rv);
  2719.     return _res;
  2720. }
  2721.  
  2722. static PyObject *TrackObj_SetTrackAlternate(_self, _args)
  2723.     TrackObject *_self;
  2724.     PyObject *_args;
  2725. {
  2726.     PyObject *_res = NULL;
  2727.     Track alternateT;
  2728.     if (!PyArg_ParseTuple(_args, "O&",
  2729.                           TrackObj_Convert, &alternateT))
  2730.         return NULL;
  2731.     SetTrackAlternate(_self->ob_itself,
  2732.                       alternateT);
  2733.     Py_INCREF(Py_None);
  2734.     _res = Py_None;
  2735.     return _res;
  2736. }
  2737.  
  2738. static PyObject *TrackObj_GetTrackVolume(_self, _args)
  2739.     TrackObject *_self;
  2740.     PyObject *_args;
  2741. {
  2742.     PyObject *_res = NULL;
  2743.     short _rv;
  2744.     if (!PyArg_ParseTuple(_args, ""))
  2745.         return NULL;
  2746.     _rv = GetTrackVolume(_self->ob_itself);
  2747.     _res = Py_BuildValue("h",
  2748.                          _rv);
  2749.     return _res;
  2750. }
  2751.  
  2752. static PyObject *TrackObj_SetTrackVolume(_self, _args)
  2753.     TrackObject *_self;
  2754.     PyObject *_args;
  2755. {
  2756.     PyObject *_res = NULL;
  2757.     short volume;
  2758.     if (!PyArg_ParseTuple(_args, "h",
  2759.                           &volume))
  2760.         return NULL;
  2761.     SetTrackVolume(_self->ob_itself,
  2762.                    volume);
  2763.     Py_INCREF(Py_None);
  2764.     _res = Py_None;
  2765.     return _res;
  2766. }
  2767.  
  2768. static PyObject *TrackObj_GetTrackDimensions(_self, _args)
  2769.     TrackObject *_self;
  2770.     PyObject *_args;
  2771. {
  2772.     PyObject *_res = NULL;
  2773.     Fixed width;
  2774.     Fixed height;
  2775.     if (!PyArg_ParseTuple(_args, ""))
  2776.         return NULL;
  2777.     GetTrackDimensions(_self->ob_itself,
  2778.                        &width,
  2779.                        &height);
  2780.     _res = Py_BuildValue("O&O&",
  2781.                          PyMac_BuildFixed, width,
  2782.                          PyMac_BuildFixed, height);
  2783.     return _res;
  2784. }
  2785.  
  2786. static PyObject *TrackObj_SetTrackDimensions(_self, _args)
  2787.     TrackObject *_self;
  2788.     PyObject *_args;
  2789. {
  2790.     PyObject *_res = NULL;
  2791.     Fixed width;
  2792.     Fixed height;
  2793.     if (!PyArg_ParseTuple(_args, "O&O&",
  2794.                           PyMac_GetFixed, &width,
  2795.                           PyMac_GetFixed, &height))
  2796.         return NULL;
  2797.     SetTrackDimensions(_self->ob_itself,
  2798.                        width,
  2799.                        height);
  2800.     Py_INCREF(Py_None);
  2801.     _res = Py_None;
  2802.     return _res;
  2803. }
  2804.  
  2805. static PyObject *TrackObj_GetTrackUserData(_self, _args)
  2806.     TrackObject *_self;
  2807.     PyObject *_args;
  2808. {
  2809.     PyObject *_res = NULL;
  2810.     UserData _rv;
  2811.     if (!PyArg_ParseTuple(_args, ""))
  2812.         return NULL;
  2813.     _rv = GetTrackUserData(_self->ob_itself);
  2814.     _res = Py_BuildValue("O&",
  2815.                          UserDataObj_New, _rv);
  2816.     return _res;
  2817. }
  2818.  
  2819. static PyObject *TrackObj_NewTrackMedia(_self, _args)
  2820.     TrackObject *_self;
  2821.     PyObject *_args;
  2822. {
  2823.     PyObject *_res = NULL;
  2824.     Media _rv;
  2825.     OSType mediaType;
  2826.     TimeScale timeScale;
  2827.     Handle dataRef;
  2828.     OSType dataRefType;
  2829.     if (!PyArg_ParseTuple(_args, "O&lO&O&",
  2830.                           PyMac_GetOSType, &mediaType,
  2831.                           &timeScale,
  2832.                           ResObj_Convert, &dataRef,
  2833.                           PyMac_GetOSType, &dataRefType))
  2834.         return NULL;
  2835.     _rv = NewTrackMedia(_self->ob_itself,
  2836.                         mediaType,
  2837.                         timeScale,
  2838.                         dataRef,
  2839.                         dataRefType);
  2840.     _res = Py_BuildValue("O&",
  2841.                          MediaObj_New, _rv);
  2842.     return _res;
  2843. }
  2844.  
  2845. static PyObject *TrackObj_GetTrackMedia(_self, _args)
  2846.     TrackObject *_self;
  2847.     PyObject *_args;
  2848. {
  2849.     PyObject *_res = NULL;
  2850.     Media _rv;
  2851.     if (!PyArg_ParseTuple(_args, ""))
  2852.         return NULL;
  2853.     _rv = GetTrackMedia(_self->ob_itself);
  2854.     _res = Py_BuildValue("O&",
  2855.                          MediaObj_New, _rv);
  2856.     return _res;
  2857. }
  2858.  
  2859. static PyObject *TrackObj_InsertMediaIntoTrack(_self, _args)
  2860.     TrackObject *_self;
  2861.     PyObject *_args;
  2862. {
  2863.     PyObject *_res = NULL;
  2864.     OSErr _err;
  2865.     TimeValue trackStart;
  2866.     TimeValue mediaTime;
  2867.     TimeValue mediaDuration;
  2868.     Fixed mediaRate;
  2869.     if (!PyArg_ParseTuple(_args, "lllO&",
  2870.                           &trackStart,
  2871.                           &mediaTime,
  2872.                           &mediaDuration,
  2873.                           PyMac_GetFixed, &mediaRate))
  2874.         return NULL;
  2875.     _err = InsertMediaIntoTrack(_self->ob_itself,
  2876.                                 trackStart,
  2877.                                 mediaTime,
  2878.                                 mediaDuration,
  2879.                                 mediaRate);
  2880.     if (_err != noErr) return PyMac_Error(_err);
  2881.     Py_INCREF(Py_None);
  2882.     _res = Py_None;
  2883.     return _res;
  2884. }
  2885.  
  2886. static PyObject *TrackObj_InsertTrackSegment(_self, _args)
  2887.     TrackObject *_self;
  2888.     PyObject *_args;
  2889. {
  2890.     PyObject *_res = NULL;
  2891.     OSErr _err;
  2892.     Track dstTrack;
  2893.     TimeValue srcIn;
  2894.     TimeValue srcDuration;
  2895.     TimeValue dstIn;
  2896.     if (!PyArg_ParseTuple(_args, "O&lll",
  2897.                           TrackObj_Convert, &dstTrack,
  2898.                           &srcIn,
  2899.                           &srcDuration,
  2900.                           &dstIn))
  2901.         return NULL;
  2902.     _err = InsertTrackSegment(_self->ob_itself,
  2903.                               dstTrack,
  2904.                               srcIn,
  2905.                               srcDuration,
  2906.                               dstIn);
  2907.     if (_err != noErr) return PyMac_Error(_err);
  2908.     Py_INCREF(Py_None);
  2909.     _res = Py_None;
  2910.     return _res;
  2911. }
  2912.  
  2913. static PyObject *TrackObj_InsertEmptyTrackSegment(_self, _args)
  2914.     TrackObject *_self;
  2915.     PyObject *_args;
  2916. {
  2917.     PyObject *_res = NULL;
  2918.     OSErr _err;
  2919.     TimeValue dstIn;
  2920.     TimeValue dstDuration;
  2921.     if (!PyArg_ParseTuple(_args, "ll",
  2922.                           &dstIn,
  2923.                           &dstDuration))
  2924.         return NULL;
  2925.     _err = InsertEmptyTrackSegment(_self->ob_itself,
  2926.                                    dstIn,
  2927.                                    dstDuration);
  2928.     if (_err != noErr) return PyMac_Error(_err);
  2929.     Py_INCREF(Py_None);
  2930.     _res = Py_None;
  2931.     return _res;
  2932. }
  2933.  
  2934. static PyObject *TrackObj_DeleteTrackSegment(_self, _args)
  2935.     TrackObject *_self;
  2936.     PyObject *_args;
  2937. {
  2938.     PyObject *_res = NULL;
  2939.     OSErr _err;
  2940.     TimeValue startTime;
  2941.     TimeValue duration;
  2942.     if (!PyArg_ParseTuple(_args, "ll",
  2943.                           &startTime,
  2944.                           &duration))
  2945.         return NULL;
  2946.     _err = DeleteTrackSegment(_self->ob_itself,
  2947.                               startTime,
  2948.                               duration);
  2949.     if (_err != noErr) return PyMac_Error(_err);
  2950.     Py_INCREF(Py_None);
  2951.     _res = Py_None;
  2952.     return _res;
  2953. }
  2954.  
  2955. static PyObject *TrackObj_ScaleTrackSegment(_self, _args)
  2956.     TrackObject *_self;
  2957.     PyObject *_args;
  2958. {
  2959.     PyObject *_res = NULL;
  2960.     OSErr _err;
  2961.     TimeValue startTime;
  2962.     TimeValue oldDuration;
  2963.     TimeValue newDuration;
  2964.     if (!PyArg_ParseTuple(_args, "lll",
  2965.                           &startTime,
  2966.                           &oldDuration,
  2967.                           &newDuration))
  2968.         return NULL;
  2969.     _err = ScaleTrackSegment(_self->ob_itself,
  2970.                              startTime,
  2971.                              oldDuration,
  2972.                              newDuration);
  2973.     if (_err != noErr) return PyMac_Error(_err);
  2974.     Py_INCREF(Py_None);
  2975.     _res = Py_None;
  2976.     return _res;
  2977. }
  2978.  
  2979. static PyObject *TrackObj_IsScrapMovie(_self, _args)
  2980.     TrackObject *_self;
  2981.     PyObject *_args;
  2982. {
  2983.     PyObject *_res = NULL;
  2984.     Component _rv;
  2985.     if (!PyArg_ParseTuple(_args, ""))
  2986.         return NULL;
  2987.     _rv = IsScrapMovie(_self->ob_itself);
  2988.     _res = Py_BuildValue("O&",
  2989.                          CmpObj_New, _rv);
  2990.     return _res;
  2991. }
  2992.  
  2993. static PyObject *TrackObj_CopyTrackSettings(_self, _args)
  2994.     TrackObject *_self;
  2995.     PyObject *_args;
  2996. {
  2997.     PyObject *_res = NULL;
  2998.     OSErr _err;
  2999.     Track dstTrack;
  3000.     if (!PyArg_ParseTuple(_args, "O&",
  3001.                           TrackObj_Convert, &dstTrack))
  3002.         return NULL;
  3003.     _err = CopyTrackSettings(_self->ob_itself,
  3004.                              dstTrack);
  3005.     if (_err != noErr) return PyMac_Error(_err);
  3006.     Py_INCREF(Py_None);
  3007.     _res = Py_None;
  3008.     return _res;
  3009. }
  3010.  
  3011. static PyObject *TrackObj_AddEmptyTrackToMovie(_self, _args)
  3012.     TrackObject *_self;
  3013.     PyObject *_args;
  3014. {
  3015.     PyObject *_res = NULL;
  3016.     OSErr _err;
  3017.     Movie dstMovie;
  3018.     Handle dataRef;
  3019.     OSType dataRefType;
  3020.     Track dstTrack;
  3021.     if (!PyArg_ParseTuple(_args, "O&O&O&",
  3022.                           MovieObj_Convert, &dstMovie,
  3023.                           ResObj_Convert, &dataRef,
  3024.                           PyMac_GetOSType, &dataRefType))
  3025.         return NULL;
  3026.     _err = AddEmptyTrackToMovie(_self->ob_itself,
  3027.                                 dstMovie,
  3028.                                 dataRef,
  3029.                                 dataRefType,
  3030.                                 &dstTrack);
  3031.     if (_err != noErr) return PyMac_Error(_err);
  3032.     _res = Py_BuildValue("O&",
  3033.                          TrackObj_New, dstTrack);
  3034.     return _res;
  3035. }
  3036.  
  3037. static PyObject *TrackObj_AddTrackReference(_self, _args)
  3038.     TrackObject *_self;
  3039.     PyObject *_args;
  3040. {
  3041.     PyObject *_res = NULL;
  3042.     OSErr _err;
  3043.     Track refTrack;
  3044.     OSType refType;
  3045.     long addedIndex;
  3046.     if (!PyArg_ParseTuple(_args, "O&O&",
  3047.                           TrackObj_Convert, &refTrack,
  3048.                           PyMac_GetOSType, &refType))
  3049.         return NULL;
  3050.     _err = AddTrackReference(_self->ob_itself,
  3051.                              refTrack,
  3052.                              refType,
  3053.                              &addedIndex);
  3054.     if (_err != noErr) return PyMac_Error(_err);
  3055.     _res = Py_BuildValue("l",
  3056.                          addedIndex);
  3057.     return _res;
  3058. }
  3059.  
  3060. static PyObject *TrackObj_DeleteTrackReference(_self, _args)
  3061.     TrackObject *_self;
  3062.     PyObject *_args;
  3063. {
  3064.     PyObject *_res = NULL;
  3065.     OSErr _err;
  3066.     OSType refType;
  3067.     long index;
  3068.     if (!PyArg_ParseTuple(_args, "O&l",
  3069.                           PyMac_GetOSType, &refType,
  3070.                           &index))
  3071.         return NULL;
  3072.     _err = DeleteTrackReference(_self->ob_itself,
  3073.                                 refType,
  3074.                                 index);
  3075.     if (_err != noErr) return PyMac_Error(_err);
  3076.     Py_INCREF(Py_None);
  3077.     _res = Py_None;
  3078.     return _res;
  3079. }
  3080.  
  3081. static PyObject *TrackObj_SetTrackReference(_self, _args)
  3082.     TrackObject *_self;
  3083.     PyObject *_args;
  3084. {
  3085.     PyObject *_res = NULL;
  3086.     OSErr _err;
  3087.     Track refTrack;
  3088.     OSType refType;
  3089.     long index;
  3090.     if (!PyArg_ParseTuple(_args, "O&O&l",
  3091.                           TrackObj_Convert, &refTrack,
  3092.                           PyMac_GetOSType, &refType,
  3093.                           &index))
  3094.         return NULL;
  3095.     _err = SetTrackReference(_self->ob_itself,
  3096.                              refTrack,
  3097.                              refType,
  3098.                              index);
  3099.     if (_err != noErr) return PyMac_Error(_err);
  3100.     Py_INCREF(Py_None);
  3101.     _res = Py_None;
  3102.     return _res;
  3103. }
  3104.  
  3105. static PyObject *TrackObj_GetTrackReference(_self, _args)
  3106.     TrackObject *_self;
  3107.     PyObject *_args;
  3108. {
  3109.     PyObject *_res = NULL;
  3110.     Track _rv;
  3111.     OSType refType;
  3112.     long index;
  3113.     if (!PyArg_ParseTuple(_args, "O&l",
  3114.                           PyMac_GetOSType, &refType,
  3115.                           &index))
  3116.         return NULL;
  3117.     _rv = GetTrackReference(_self->ob_itself,
  3118.                             refType,
  3119.                             index);
  3120.     _res = Py_BuildValue("O&",
  3121.                          TrackObj_New, _rv);
  3122.     return _res;
  3123. }
  3124.  
  3125. static PyObject *TrackObj_GetNextTrackReferenceType(_self, _args)
  3126.     TrackObject *_self;
  3127.     PyObject *_args;
  3128. {
  3129.     PyObject *_res = NULL;
  3130.     OSType _rv;
  3131.     OSType refType;
  3132.     if (!PyArg_ParseTuple(_args, "O&",
  3133.                           PyMac_GetOSType, &refType))
  3134.         return NULL;
  3135.     _rv = GetNextTrackReferenceType(_self->ob_itself,
  3136.                                     refType);
  3137.     _res = Py_BuildValue("O&",
  3138.                          PyMac_BuildOSType, _rv);
  3139.     return _res;
  3140. }
  3141.  
  3142. static PyObject *TrackObj_GetTrackReferenceCount(_self, _args)
  3143.     TrackObject *_self;
  3144.     PyObject *_args;
  3145. {
  3146.     PyObject *_res = NULL;
  3147.     long _rv;
  3148.     OSType refType;
  3149.     if (!PyArg_ParseTuple(_args, "O&",
  3150.                           PyMac_GetOSType, &refType))
  3151.         return NULL;
  3152.     _rv = GetTrackReferenceCount(_self->ob_itself,
  3153.                                  refType);
  3154.     _res = Py_BuildValue("l",
  3155.                          _rv);
  3156.     return _res;
  3157. }
  3158.  
  3159. static PyObject *TrackObj_GetTrackEditRate(_self, _args)
  3160.     TrackObject *_self;
  3161.     PyObject *_args;
  3162. {
  3163.     PyObject *_res = NULL;
  3164.     Fixed _rv;
  3165.     TimeValue atTime;
  3166.     if (!PyArg_ParseTuple(_args, "l",
  3167.                           &atTime))
  3168.         return NULL;
  3169.     _rv = GetTrackEditRate(_self->ob_itself,
  3170.                            atTime);
  3171.     _res = Py_BuildValue("O&",
  3172.                          PyMac_BuildFixed, _rv);
  3173.     return _res;
  3174. }
  3175.  
  3176. static PyObject *TrackObj_GetTrackDataSize(_self, _args)
  3177.     TrackObject *_self;
  3178.     PyObject *_args;
  3179. {
  3180.     PyObject *_res = NULL;
  3181.     long _rv;
  3182.     TimeValue startTime;
  3183.     TimeValue duration;
  3184.     if (!PyArg_ParseTuple(_args, "ll",
  3185.                           &startTime,
  3186.                           &duration))
  3187.         return NULL;
  3188.     _rv = GetTrackDataSize(_self->ob_itself,
  3189.                            startTime,
  3190.                            duration);
  3191.     _res = Py_BuildValue("l",
  3192.                          _rv);
  3193.     return _res;
  3194. }
  3195.  
  3196. static PyObject *TrackObj_PtInTrack(_self, _args)
  3197.     TrackObject *_self;
  3198.     PyObject *_args;
  3199. {
  3200.     PyObject *_res = NULL;
  3201.     Boolean _rv;
  3202.     Point pt;
  3203.     if (!PyArg_ParseTuple(_args, "O&",
  3204.                           PyMac_GetPoint, &pt))
  3205.         return NULL;
  3206.     _rv = PtInTrack(_self->ob_itself,
  3207.                     pt);
  3208.     _res = Py_BuildValue("b",
  3209.                          _rv);
  3210.     return _res;
  3211. }
  3212.  
  3213. static PyObject *TrackObj_GetTrackNextInterestingTime(_self, _args)
  3214.     TrackObject *_self;
  3215.     PyObject *_args;
  3216. {
  3217.     PyObject *_res = NULL;
  3218.     short interestingTimeFlags;
  3219.     TimeValue time;
  3220.     Fixed rate;
  3221.     TimeValue interestingTime;
  3222.     TimeValue interestingDuration;
  3223.     if (!PyArg_ParseTuple(_args, "hlO&",
  3224.                           &interestingTimeFlags,
  3225.                           &time,
  3226.                           PyMac_GetFixed, &rate))
  3227.         return NULL;
  3228.     GetTrackNextInterestingTime(_self->ob_itself,
  3229.                                 interestingTimeFlags,
  3230.                                 time,
  3231.                                 rate,
  3232.                                 &interestingTime,
  3233.                                 &interestingDuration);
  3234.     _res = Py_BuildValue("ll",
  3235.                          interestingTime,
  3236.                          interestingDuration);
  3237.     return _res;
  3238. }
  3239.  
  3240. static PyObject *TrackObj_GetTrackSegmentDisplayBoundsRgn(_self, _args)
  3241.     TrackObject *_self;
  3242.     PyObject *_args;
  3243. {
  3244.     PyObject *_res = NULL;
  3245.     RgnHandle _rv;
  3246.     TimeValue time;
  3247.     TimeValue duration;
  3248.     if (!PyArg_ParseTuple(_args, "ll",
  3249.                           &time,
  3250.                           &duration))
  3251.         return NULL;
  3252.     _rv = GetTrackSegmentDisplayBoundsRgn(_self->ob_itself,
  3253.                                           time,
  3254.                                           duration);
  3255.     _res = Py_BuildValue("O&",
  3256.                          ResObj_New, _rv);
  3257.     return _res;
  3258. }
  3259.  
  3260. static PyObject *TrackObj_GetTrackStatus(_self, _args)
  3261.     TrackObject *_self;
  3262.     PyObject *_args;
  3263. {
  3264.     PyObject *_res = NULL;
  3265.     ComponentResult _rv;
  3266.     if (!PyArg_ParseTuple(_args, ""))
  3267.         return NULL;
  3268.     _rv = GetTrackStatus(_self->ob_itself);
  3269.     _res = Py_BuildValue("l",
  3270.                          _rv);
  3271.     return _res;
  3272. }
  3273.  
  3274. static PyObject *TrackObj_SetTrackLoadSettings(_self, _args)
  3275.     TrackObject *_self;
  3276.     PyObject *_args;
  3277. {
  3278.     PyObject *_res = NULL;
  3279.     TimeValue preloadTime;
  3280.     TimeValue preloadDuration;
  3281.     long preloadFlags;
  3282.     long defaultHints;
  3283.     if (!PyArg_ParseTuple(_args, "llll",
  3284.                           &preloadTime,
  3285.                           &preloadDuration,
  3286.                           &preloadFlags,
  3287.                           &defaultHints))
  3288.         return NULL;
  3289.     SetTrackLoadSettings(_self->ob_itself,
  3290.                          preloadTime,
  3291.                          preloadDuration,
  3292.                          preloadFlags,
  3293.                          defaultHints);
  3294.     Py_INCREF(Py_None);
  3295.     _res = Py_None;
  3296.     return _res;
  3297. }
  3298.  
  3299. static PyObject *TrackObj_GetTrackLoadSettings(_self, _args)
  3300.     TrackObject *_self;
  3301.     PyObject *_args;
  3302. {
  3303.     PyObject *_res = NULL;
  3304.     TimeValue preloadTime;
  3305.     TimeValue preloadDuration;
  3306.     long preloadFlags;
  3307.     long defaultHints;
  3308.     if (!PyArg_ParseTuple(_args, ""))
  3309.         return NULL;
  3310.     GetTrackLoadSettings(_self->ob_itself,
  3311.                          &preloadTime,
  3312.                          &preloadDuration,
  3313.                          &preloadFlags,
  3314.                          &defaultHints);
  3315.     _res = Py_BuildValue("llll",
  3316.                          preloadTime,
  3317.                          preloadDuration,
  3318.                          preloadFlags,
  3319.                          defaultHints);
  3320.     return _res;
  3321. }
  3322.  
  3323. static PyMethodDef TrackObj_methods[] = {
  3324.     {"LoadTrackIntoRam", (PyCFunction)TrackObj_LoadTrackIntoRam, 1,
  3325.      "(TimeValue time, TimeValue duration, long flags) -> None"},
  3326.     {"GetTrackPict", (PyCFunction)TrackObj_GetTrackPict, 1,
  3327.      "(TimeValue time) -> (PicHandle _rv)"},
  3328.     {"GetTrackClipRgn", (PyCFunction)TrackObj_GetTrackClipRgn, 1,
  3329.      "() -> (RgnHandle _rv)"},
  3330.     {"SetTrackClipRgn", (PyCFunction)TrackObj_SetTrackClipRgn, 1,
  3331.      "(RgnHandle theClip) -> None"},
  3332.     {"GetTrackDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackDisplayBoundsRgn, 1,
  3333.      "() -> (RgnHandle _rv)"},
  3334.     {"GetTrackMovieBoundsRgn", (PyCFunction)TrackObj_GetTrackMovieBoundsRgn, 1,
  3335.      "() -> (RgnHandle _rv)"},
  3336.     {"GetTrackBoundsRgn", (PyCFunction)TrackObj_GetTrackBoundsRgn, 1,
  3337.      "() -> (RgnHandle _rv)"},
  3338.     {"GetTrackMatte", (PyCFunction)TrackObj_GetTrackMatte, 1,
  3339.      "() -> (PixMapHandle _rv)"},
  3340.     {"SetTrackMatte", (PyCFunction)TrackObj_SetTrackMatte, 1,
  3341.      "(PixMapHandle theMatte) -> None"},
  3342.     {"GetTrackID", (PyCFunction)TrackObj_GetTrackID, 1,
  3343.      "() -> (long _rv)"},
  3344.     {"GetTrackMovie", (PyCFunction)TrackObj_GetTrackMovie, 1,
  3345.      "() -> (Movie _rv)"},
  3346.     {"GetTrackEnabled", (PyCFunction)TrackObj_GetTrackEnabled, 1,
  3347.      "() -> (Boolean _rv)"},
  3348.     {"SetTrackEnabled", (PyCFunction)TrackObj_SetTrackEnabled, 1,
  3349.      "(Boolean isEnabled) -> None"},
  3350.     {"GetTrackUsage", (PyCFunction)TrackObj_GetTrackUsage, 1,
  3351.      "() -> (long _rv)"},
  3352.     {"SetTrackUsage", (PyCFunction)TrackObj_SetTrackUsage, 1,
  3353.      "(long usage) -> None"},
  3354.     {"GetTrackDuration", (PyCFunction)TrackObj_GetTrackDuration, 1,
  3355.      "() -> (TimeValue _rv)"},
  3356.     {"GetTrackOffset", (PyCFunction)TrackObj_GetTrackOffset, 1,
  3357.      "() -> (TimeValue _rv)"},
  3358.     {"SetTrackOffset", (PyCFunction)TrackObj_SetTrackOffset, 1,
  3359.      "(TimeValue movieOffsetTime) -> None"},
  3360.     {"GetTrackLayer", (PyCFunction)TrackObj_GetTrackLayer, 1,
  3361.      "() -> (short _rv)"},
  3362.     {"SetTrackLayer", (PyCFunction)TrackObj_SetTrackLayer, 1,
  3363.      "(short layer) -> None"},
  3364.     {"GetTrackAlternate", (PyCFunction)TrackObj_GetTrackAlternate, 1,
  3365.      "() -> (Track _rv)"},
  3366.     {"SetTrackAlternate", (PyCFunction)TrackObj_SetTrackAlternate, 1,
  3367.      "(Track alternateT) -> None"},
  3368.     {"GetTrackVolume", (PyCFunction)TrackObj_GetTrackVolume, 1,
  3369.      "() -> (short _rv)"},
  3370.     {"SetTrackVolume", (PyCFunction)TrackObj_SetTrackVolume, 1,
  3371.      "(short volume) -> None"},
  3372.     {"GetTrackDimensions", (PyCFunction)TrackObj_GetTrackDimensions, 1,
  3373.      "() -> (Fixed width, Fixed height)"},
  3374.     {"SetTrackDimensions", (PyCFunction)TrackObj_SetTrackDimensions, 1,
  3375.      "(Fixed width, Fixed height) -> None"},
  3376.     {"GetTrackUserData", (PyCFunction)TrackObj_GetTrackUserData, 1,
  3377.      "() -> (UserData _rv)"},
  3378.     {"NewTrackMedia", (PyCFunction)TrackObj_NewTrackMedia, 1,
  3379.      "(OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType) -> (Media _rv)"},
  3380.     {"GetTrackMedia", (PyCFunction)TrackObj_GetTrackMedia, 1,
  3381.      "() -> (Media _rv)"},
  3382.     {"InsertMediaIntoTrack", (PyCFunction)TrackObj_InsertMediaIntoTrack, 1,
  3383.      "(TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate) -> None"},
  3384.     {"InsertTrackSegment", (PyCFunction)TrackObj_InsertTrackSegment, 1,
  3385.      "(Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
  3386.     {"InsertEmptyTrackSegment", (PyCFunction)TrackObj_InsertEmptyTrackSegment, 1,
  3387.      "(TimeValue dstIn, TimeValue dstDuration) -> None"},
  3388.     {"DeleteTrackSegment", (PyCFunction)TrackObj_DeleteTrackSegment, 1,
  3389.      "(TimeValue startTime, TimeValue duration) -> None"},
  3390.     {"ScaleTrackSegment", (PyCFunction)TrackObj_ScaleTrackSegment, 1,
  3391.      "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
  3392.     {"IsScrapMovie", (PyCFunction)TrackObj_IsScrapMovie, 1,
  3393.      "() -> (Component _rv)"},
  3394.     {"CopyTrackSettings", (PyCFunction)TrackObj_CopyTrackSettings, 1,
  3395.      "(Track dstTrack) -> None"},
  3396.     {"AddEmptyTrackToMovie", (PyCFunction)TrackObj_AddEmptyTrackToMovie, 1,
  3397.      "(Movie dstMovie, Handle dataRef, OSType dataRefType) -> (Track dstTrack)"},
  3398.     {"AddTrackReference", (PyCFunction)TrackObj_AddTrackReference, 1,
  3399.      "(Track refTrack, OSType refType) -> (long addedIndex)"},
  3400.     {"DeleteTrackReference", (PyCFunction)TrackObj_DeleteTrackReference, 1,
  3401.      "(OSType refType, long index) -> None"},
  3402.     {"SetTrackReference", (PyCFunction)TrackObj_SetTrackReference, 1,
  3403.      "(Track refTrack, OSType refType, long index) -> None"},
  3404.     {"GetTrackReference", (PyCFunction)TrackObj_GetTrackReference, 1,
  3405.      "(OSType refType, long index) -> (Track _rv)"},
  3406.     {"GetNextTrackReferenceType", (PyCFunction)TrackObj_GetNextTrackReferenceType, 1,
  3407.      "(OSType refType) -> (OSType _rv)"},
  3408.     {"GetTrackReferenceCount", (PyCFunction)TrackObj_GetTrackReferenceCount, 1,
  3409.      "(OSType refType) -> (long _rv)"},
  3410.     {"GetTrackEditRate", (PyCFunction)TrackObj_GetTrackEditRate, 1,
  3411.      "(TimeValue atTime) -> (Fixed _rv)"},
  3412.     {"GetTrackDataSize", (PyCFunction)TrackObj_GetTrackDataSize, 1,
  3413.      "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
  3414.     {"PtInTrack", (PyCFunction)TrackObj_PtInTrack, 1,
  3415.      "(Point pt) -> (Boolean _rv)"},
  3416.     {"GetTrackNextInterestingTime", (PyCFunction)TrackObj_GetTrackNextInterestingTime, 1,
  3417.      "(short interestingTimeFlags, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
  3418.     {"GetTrackSegmentDisplayBoundsRgn", (PyCFunction)TrackObj_GetTrackSegmentDisplayBoundsRgn, 1,
  3419.      "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
  3420.     {"GetTrackStatus", (PyCFunction)TrackObj_GetTrackStatus, 1,
  3421.      "() -> (ComponentResult _rv)"},
  3422.     {"SetTrackLoadSettings", (PyCFunction)TrackObj_SetTrackLoadSettings, 1,
  3423.      "(TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints) -> None"},
  3424.     {"GetTrackLoadSettings", (PyCFunction)TrackObj_GetTrackLoadSettings, 1,
  3425.      "() -> (TimeValue preloadTime, TimeValue preloadDuration, long preloadFlags, long defaultHints)"},
  3426.     {NULL, NULL, 0}
  3427. };
  3428.  
  3429. PyMethodChain TrackObj_chain = { TrackObj_methods, NULL };
  3430.  
  3431. static PyObject *TrackObj_getattr(self, name)
  3432.     TrackObject *self;
  3433.     char *name;
  3434. {
  3435.     return Py_FindMethodInChain(&TrackObj_chain, (PyObject *)self, name);
  3436. }
  3437.  
  3438. #define TrackObj_setattr NULL
  3439.  
  3440. PyTypeObject Track_Type = {
  3441.     PyObject_HEAD_INIT(&PyType_Type)
  3442.     0, /*ob_size*/
  3443.     "Track", /*tp_name*/
  3444.     sizeof(TrackObject), /*tp_basicsize*/
  3445.     0, /*tp_itemsize*/
  3446.     /* methods */
  3447.     (destructor) TrackObj_dealloc, /*tp_dealloc*/
  3448.     0, /*tp_print*/
  3449.     (getattrfunc) TrackObj_getattr, /*tp_getattr*/
  3450.     (setattrfunc) TrackObj_setattr, /*tp_setattr*/
  3451. };
  3452.  
  3453. /* --------------------- End object type Track ---------------------- */
  3454.  
  3455.  
  3456. /* ----------------------- Object type Movie ------------------------ */
  3457.  
  3458. PyTypeObject Movie_Type;
  3459.  
  3460. #define MovieObj_Check(x) ((x)->ob_type == &Movie_Type)
  3461.  
  3462. typedef struct MovieObject {
  3463.     PyObject_HEAD
  3464.     Movie ob_itself;
  3465. } MovieObject;
  3466.  
  3467. PyObject *MovieObj_New(itself)
  3468.     Movie itself;
  3469. {
  3470.     MovieObject *it;
  3471.     if (itself == NULL) {
  3472.                         PyErr_SetString(Qt_Error,"Cannot create null Movie");
  3473.                         return NULL;
  3474.                     }
  3475.     it = PyObject_NEW(MovieObject, &Movie_Type);
  3476.     if (it == NULL) return NULL;
  3477.     it->ob_itself = itself;
  3478.     return (PyObject *)it;
  3479. }
  3480. MovieObj_Convert(v, p_itself)
  3481.     PyObject *v;
  3482.     Movie *p_itself;
  3483. {
  3484.     if (!MovieObj_Check(v))
  3485.     {
  3486.         PyErr_SetString(PyExc_TypeError, "Movie required");
  3487.         return 0;
  3488.     }
  3489.     *p_itself = ((MovieObject *)v)->ob_itself;
  3490.     return 1;
  3491. }
  3492.  
  3493. static void MovieObj_dealloc(self)
  3494.     MovieObject *self;
  3495. {
  3496.     DisposeMovie(self->ob_itself);
  3497.     PyMem_DEL(self);
  3498. }
  3499.  
  3500. static PyObject *MovieObj_MoviesTask(_self, _args)
  3501.     MovieObject *_self;
  3502.     PyObject *_args;
  3503. {
  3504.     PyObject *_res = NULL;
  3505.     long maxMilliSecToUse;
  3506.     if (!PyArg_ParseTuple(_args, "l",
  3507.                           &maxMilliSecToUse))
  3508.         return NULL;
  3509.     MoviesTask(_self->ob_itself,
  3510.                maxMilliSecToUse);
  3511.     Py_INCREF(Py_None);
  3512.     _res = Py_None;
  3513.     return _res;
  3514. }
  3515.  
  3516. static PyObject *MovieObj_PrerollMovie(_self, _args)
  3517.     MovieObject *_self;
  3518.     PyObject *_args;
  3519. {
  3520.     PyObject *_res = NULL;
  3521.     OSErr _err;
  3522.     TimeValue time;
  3523.     Fixed Rate;
  3524.     if (!PyArg_ParseTuple(_args, "lO&",
  3525.                           &time,
  3526.                           PyMac_GetFixed, &Rate))
  3527.         return NULL;
  3528.     _err = PrerollMovie(_self->ob_itself,
  3529.                         time,
  3530.                         Rate);
  3531.     if (_err != noErr) return PyMac_Error(_err);
  3532.     Py_INCREF(Py_None);
  3533.     _res = Py_None;
  3534.     return _res;
  3535. }
  3536.  
  3537. static PyObject *MovieObj_LoadMovieIntoRam(_self, _args)
  3538.     MovieObject *_self;
  3539.     PyObject *_args;
  3540. {
  3541.     PyObject *_res = NULL;
  3542.     OSErr _err;
  3543.     TimeValue time;
  3544.     TimeValue duration;
  3545.     long flags;
  3546.     if (!PyArg_ParseTuple(_args, "lll",
  3547.                           &time,
  3548.                           &duration,
  3549.                           &flags))
  3550.         return NULL;
  3551.     _err = LoadMovieIntoRam(_self->ob_itself,
  3552.                             time,
  3553.                             duration,
  3554.                             flags);
  3555.     if (_err != noErr) return PyMac_Error(_err);
  3556.     Py_INCREF(Py_None);
  3557.     _res = Py_None;
  3558.     return _res;
  3559. }
  3560.  
  3561. static PyObject *MovieObj_SetMovieActive(_self, _args)
  3562.     MovieObject *_self;
  3563.     PyObject *_args;
  3564. {
  3565.     PyObject *_res = NULL;
  3566.     Boolean active;
  3567.     if (!PyArg_ParseTuple(_args, "b",
  3568.                           &active))
  3569.         return NULL;
  3570.     SetMovieActive(_self->ob_itself,
  3571.                    active);
  3572.     Py_INCREF(Py_None);
  3573.     _res = Py_None;
  3574.     return _res;
  3575. }
  3576.  
  3577. static PyObject *MovieObj_GetMovieActive(_self, _args)
  3578.     MovieObject *_self;
  3579.     PyObject *_args;
  3580. {
  3581.     PyObject *_res = NULL;
  3582.     Boolean _rv;
  3583.     if (!PyArg_ParseTuple(_args, ""))
  3584.         return NULL;
  3585.     _rv = GetMovieActive(_self->ob_itself);
  3586.     _res = Py_BuildValue("b",
  3587.                          _rv);
  3588.     return _res;
  3589. }
  3590.  
  3591. static PyObject *MovieObj_StartMovie(_self, _args)
  3592.     MovieObject *_self;
  3593.     PyObject *_args;
  3594. {
  3595.     PyObject *_res = NULL;
  3596.     if (!PyArg_ParseTuple(_args, ""))
  3597.         return NULL;
  3598.     StartMovie(_self->ob_itself);
  3599.     Py_INCREF(Py_None);
  3600.     _res = Py_None;
  3601.     return _res;
  3602. }
  3603.  
  3604. static PyObject *MovieObj_StopMovie(_self, _args)
  3605.     MovieObject *_self;
  3606.     PyObject *_args;
  3607. {
  3608.     PyObject *_res = NULL;
  3609.     if (!PyArg_ParseTuple(_args, ""))
  3610.         return NULL;
  3611.     StopMovie(_self->ob_itself);
  3612.     Py_INCREF(Py_None);
  3613.     _res = Py_None;
  3614.     return _res;
  3615. }
  3616.  
  3617. static PyObject *MovieObj_GoToBeginningOfMovie(_self, _args)
  3618.     MovieObject *_self;
  3619.     PyObject *_args;
  3620. {
  3621.     PyObject *_res = NULL;
  3622.     if (!PyArg_ParseTuple(_args, ""))
  3623.         return NULL;
  3624.     GoToBeginningOfMovie(_self->ob_itself);
  3625.     Py_INCREF(Py_None);
  3626.     _res = Py_None;
  3627.     return _res;
  3628. }
  3629.  
  3630. static PyObject *MovieObj_GoToEndOfMovie(_self, _args)
  3631.     MovieObject *_self;
  3632.     PyObject *_args;
  3633. {
  3634.     PyObject *_res = NULL;
  3635.     if (!PyArg_ParseTuple(_args, ""))
  3636.         return NULL;
  3637.     GoToEndOfMovie(_self->ob_itself);
  3638.     Py_INCREF(Py_None);
  3639.     _res = Py_None;
  3640.     return _res;
  3641. }
  3642.  
  3643. static PyObject *MovieObj_IsMovieDone(_self, _args)
  3644.     MovieObject *_self;
  3645.     PyObject *_args;
  3646. {
  3647.     PyObject *_res = NULL;
  3648.     Boolean _rv;
  3649.     if (!PyArg_ParseTuple(_args, ""))
  3650.         return NULL;
  3651.     _rv = IsMovieDone(_self->ob_itself);
  3652.     _res = Py_BuildValue("b",
  3653.                          _rv);
  3654.     return _res;
  3655. }
  3656.  
  3657. static PyObject *MovieObj_GetMoviePreviewMode(_self, _args)
  3658.     MovieObject *_self;
  3659.     PyObject *_args;
  3660. {
  3661.     PyObject *_res = NULL;
  3662.     Boolean _rv;
  3663.     if (!PyArg_ParseTuple(_args, ""))
  3664.         return NULL;
  3665.     _rv = GetMoviePreviewMode(_self->ob_itself);
  3666.     _res = Py_BuildValue("b",
  3667.                          _rv);
  3668.     return _res;
  3669. }
  3670.  
  3671. static PyObject *MovieObj_SetMoviePreviewMode(_self, _args)
  3672.     MovieObject *_self;
  3673.     PyObject *_args;
  3674. {
  3675.     PyObject *_res = NULL;
  3676.     Boolean usePreview;
  3677.     if (!PyArg_ParseTuple(_args, "b",
  3678.                           &usePreview))
  3679.         return NULL;
  3680.     SetMoviePreviewMode(_self->ob_itself,
  3681.                         usePreview);
  3682.     Py_INCREF(Py_None);
  3683.     _res = Py_None;
  3684.     return _res;
  3685. }
  3686.  
  3687. static PyObject *MovieObj_ShowMoviePoster(_self, _args)
  3688.     MovieObject *_self;
  3689.     PyObject *_args;
  3690. {
  3691.     PyObject *_res = NULL;
  3692.     if (!PyArg_ParseTuple(_args, ""))
  3693.         return NULL;
  3694.     ShowMoviePoster(_self->ob_itself);
  3695.     Py_INCREF(Py_None);
  3696.     _res = Py_None;
  3697.     return _res;
  3698. }
  3699.  
  3700. static PyObject *MovieObj_GetMovieTimeBase(_self, _args)
  3701.     MovieObject *_self;
  3702.     PyObject *_args;
  3703. {
  3704.     PyObject *_res = NULL;
  3705.     TimeBase _rv;
  3706.     if (!PyArg_ParseTuple(_args, ""))
  3707.         return NULL;
  3708.     _rv = GetMovieTimeBase(_self->ob_itself);
  3709.     _res = Py_BuildValue("O&",
  3710.                          TimeBaseObj_New, _rv);
  3711.     return _res;
  3712. }
  3713.  
  3714. static PyObject *MovieObj_GetNextTrackForCompositing(_self, _args)
  3715.     MovieObject *_self;
  3716.     PyObject *_args;
  3717. {
  3718.     PyObject *_res = NULL;
  3719.     Track _rv;
  3720.     Track theTrack;
  3721.     if (!PyArg_ParseTuple(_args, "O&",
  3722.                           TrackObj_Convert, &theTrack))
  3723.         return NULL;
  3724.     _rv = GetNextTrackForCompositing(_self->ob_itself,
  3725.                                      theTrack);
  3726.     _res = Py_BuildValue("O&",
  3727.                          TrackObj_New, _rv);
  3728.     return _res;
  3729. }
  3730.  
  3731. static PyObject *MovieObj_GetPrevTrackForCompositing(_self, _args)
  3732.     MovieObject *_self;
  3733.     PyObject *_args;
  3734. {
  3735.     PyObject *_res = NULL;
  3736.     Track _rv;
  3737.     Track theTrack;
  3738.     if (!PyArg_ParseTuple(_args, "O&",
  3739.                           TrackObj_Convert, &theTrack))
  3740.         return NULL;
  3741.     _rv = GetPrevTrackForCompositing(_self->ob_itself,
  3742.                                      theTrack);
  3743.     _res = Py_BuildValue("O&",
  3744.                          TrackObj_New, _rv);
  3745.     return _res;
  3746. }
  3747.  
  3748. static PyObject *MovieObj_GetMoviePict(_self, _args)
  3749.     MovieObject *_self;
  3750.     PyObject *_args;
  3751. {
  3752.     PyObject *_res = NULL;
  3753.     PicHandle _rv;
  3754.     TimeValue time;
  3755.     if (!PyArg_ParseTuple(_args, "l",
  3756.                           &time))
  3757.         return NULL;
  3758.     _rv = GetMoviePict(_self->ob_itself,
  3759.                        time);
  3760.     _res = Py_BuildValue("O&",
  3761.                          ResObj_New, _rv);
  3762.     return _res;
  3763. }
  3764.  
  3765. static PyObject *MovieObj_GetMoviePosterPict(_self, _args)
  3766.     MovieObject *_self;
  3767.     PyObject *_args;
  3768. {
  3769.     PyObject *_res = NULL;
  3770.     PicHandle _rv;
  3771.     if (!PyArg_ParseTuple(_args, ""))
  3772.         return NULL;
  3773.     _rv = GetMoviePosterPict(_self->ob_itself);
  3774.     _res = Py_BuildValue("O&",
  3775.                          ResObj_New, _rv);
  3776.     return _res;
  3777. }
  3778.  
  3779. static PyObject *MovieObj_UpdateMovie(_self, _args)
  3780.     MovieObject *_self;
  3781.     PyObject *_args;
  3782. {
  3783.     PyObject *_res = NULL;
  3784.     OSErr _err;
  3785.     if (!PyArg_ParseTuple(_args, ""))
  3786.         return NULL;
  3787.     _err = UpdateMovie(_self->ob_itself);
  3788.     if (_err != noErr) return PyMac_Error(_err);
  3789.     Py_INCREF(Py_None);
  3790.     _res = Py_None;
  3791.     return _res;
  3792. }
  3793.  
  3794. static PyObject *MovieObj_GetMovieBox(_self, _args)
  3795.     MovieObject *_self;
  3796.     PyObject *_args;
  3797. {
  3798.     PyObject *_res = NULL;
  3799.     Rect boxRect;
  3800.     if (!PyArg_ParseTuple(_args, ""))
  3801.         return NULL;
  3802.     GetMovieBox(_self->ob_itself,
  3803.                 &boxRect);
  3804.     _res = Py_BuildValue("O&",
  3805.                          PyMac_BuildRect, &boxRect);
  3806.     return _res;
  3807. }
  3808.  
  3809. static PyObject *MovieObj_SetMovieBox(_self, _args)
  3810.     MovieObject *_self;
  3811.     PyObject *_args;
  3812. {
  3813.     PyObject *_res = NULL;
  3814.     Rect boxRect;
  3815.     if (!PyArg_ParseTuple(_args, "O&",
  3816.                           PyMac_GetRect, &boxRect))
  3817.         return NULL;
  3818.     SetMovieBox(_self->ob_itself,
  3819.                 &boxRect);
  3820.     Py_INCREF(Py_None);
  3821.     _res = Py_None;
  3822.     return _res;
  3823. }
  3824.  
  3825. static PyObject *MovieObj_GetMovieDisplayClipRgn(_self, _args)
  3826.     MovieObject *_self;
  3827.     PyObject *_args;
  3828. {
  3829.     PyObject *_res = NULL;
  3830.     RgnHandle _rv;
  3831.     if (!PyArg_ParseTuple(_args, ""))
  3832.         return NULL;
  3833.     _rv = GetMovieDisplayClipRgn(_self->ob_itself);
  3834.     _res = Py_BuildValue("O&",
  3835.                          ResObj_New, _rv);
  3836.     return _res;
  3837. }
  3838.  
  3839. static PyObject *MovieObj_SetMovieDisplayClipRgn(_self, _args)
  3840.     MovieObject *_self;
  3841.     PyObject *_args;
  3842. {
  3843.     PyObject *_res = NULL;
  3844.     RgnHandle theClip;
  3845.     if (!PyArg_ParseTuple(_args, "O&",
  3846.                           ResObj_Convert, &theClip))
  3847.         return NULL;
  3848.     SetMovieDisplayClipRgn(_self->ob_itself,
  3849.                            theClip);
  3850.     Py_INCREF(Py_None);
  3851.     _res = Py_None;
  3852.     return _res;
  3853. }
  3854.  
  3855. static PyObject *MovieObj_GetMovieClipRgn(_self, _args)
  3856.     MovieObject *_self;
  3857.     PyObject *_args;
  3858. {
  3859.     PyObject *_res = NULL;
  3860.     RgnHandle _rv;
  3861.     if (!PyArg_ParseTuple(_args, ""))
  3862.         return NULL;
  3863.     _rv = GetMovieClipRgn(_self->ob_itself);
  3864.     _res = Py_BuildValue("O&",
  3865.                          ResObj_New, _rv);
  3866.     return _res;
  3867. }
  3868.  
  3869. static PyObject *MovieObj_SetMovieClipRgn(_self, _args)
  3870.     MovieObject *_self;
  3871.     PyObject *_args;
  3872. {
  3873.     PyObject *_res = NULL;
  3874.     RgnHandle theClip;
  3875.     if (!PyArg_ParseTuple(_args, "O&",
  3876.                           ResObj_Convert, &theClip))
  3877.         return NULL;
  3878.     SetMovieClipRgn(_self->ob_itself,
  3879.                     theClip);
  3880.     Py_INCREF(Py_None);
  3881.     _res = Py_None;
  3882.     return _res;
  3883. }
  3884.  
  3885. static PyObject *MovieObj_GetMovieDisplayBoundsRgn(_self, _args)
  3886.     MovieObject *_self;
  3887.     PyObject *_args;
  3888. {
  3889.     PyObject *_res = NULL;
  3890.     RgnHandle _rv;
  3891.     if (!PyArg_ParseTuple(_args, ""))
  3892.         return NULL;
  3893.     _rv = GetMovieDisplayBoundsRgn(_self->ob_itself);
  3894.     _res = Py_BuildValue("O&",
  3895.                          ResObj_New, _rv);
  3896.     return _res;
  3897. }
  3898.  
  3899. static PyObject *MovieObj_GetMovieBoundsRgn(_self, _args)
  3900.     MovieObject *_self;
  3901.     PyObject *_args;
  3902. {
  3903.     PyObject *_res = NULL;
  3904.     RgnHandle _rv;
  3905.     if (!PyArg_ParseTuple(_args, ""))
  3906.         return NULL;
  3907.     _rv = GetMovieBoundsRgn(_self->ob_itself);
  3908.     _res = Py_BuildValue("O&",
  3909.                          ResObj_New, _rv);
  3910.     return _res;
  3911. }
  3912.  
  3913. static PyObject *MovieObj_PutMovieIntoHandle(_self, _args)
  3914.     MovieObject *_self;
  3915.     PyObject *_args;
  3916. {
  3917.     PyObject *_res = NULL;
  3918.     OSErr _err;
  3919.     Handle publicMovie;
  3920.     if (!PyArg_ParseTuple(_args, "O&",
  3921.                           ResObj_Convert, &publicMovie))
  3922.         return NULL;
  3923.     _err = PutMovieIntoHandle(_self->ob_itself,
  3924.                               publicMovie);
  3925.     if (_err != noErr) return PyMac_Error(_err);
  3926.     Py_INCREF(Py_None);
  3927.     _res = Py_None;
  3928.     return _res;
  3929. }
  3930.  
  3931. static PyObject *MovieObj_PutMovieIntoDataFork(_self, _args)
  3932.     MovieObject *_self;
  3933.     PyObject *_args;
  3934. {
  3935.     PyObject *_res = NULL;
  3936.     OSErr _err;
  3937.     short fRefNum;
  3938.     long offset;
  3939.     long maxSize;
  3940.     if (!PyArg_ParseTuple(_args, "hll",
  3941.                           &fRefNum,
  3942.                           &offset,
  3943.                           &maxSize))
  3944.         return NULL;
  3945.     _err = PutMovieIntoDataFork(_self->ob_itself,
  3946.                                 fRefNum,
  3947.                                 offset,
  3948.                                 maxSize);
  3949.     if (_err != noErr) return PyMac_Error(_err);
  3950.     Py_INCREF(Py_None);
  3951.     _res = Py_None;
  3952.     return _res;
  3953. }
  3954.  
  3955. static PyObject *MovieObj_GetMovieTimeScale(_self, _args)
  3956.     MovieObject *_self;
  3957.     PyObject *_args;
  3958. {
  3959.     PyObject *_res = NULL;
  3960.     TimeScale _rv;
  3961.     if (!PyArg_ParseTuple(_args, ""))
  3962.         return NULL;
  3963.     _rv = GetMovieTimeScale(_self->ob_itself);
  3964.     _res = Py_BuildValue("l",
  3965.                          _rv);
  3966.     return _res;
  3967. }
  3968.  
  3969. static PyObject *MovieObj_SetMovieTimeScale(_self, _args)
  3970.     MovieObject *_self;
  3971.     PyObject *_args;
  3972. {
  3973.     PyObject *_res = NULL;
  3974.     TimeScale timeScale;
  3975.     if (!PyArg_ParseTuple(_args, "l",
  3976.                           &timeScale))
  3977.         return NULL;
  3978.     SetMovieTimeScale(_self->ob_itself,
  3979.                       timeScale);
  3980.     Py_INCREF(Py_None);
  3981.     _res = Py_None;
  3982.     return _res;
  3983. }
  3984.  
  3985. static PyObject *MovieObj_GetMovieDuration(_self, _args)
  3986.     MovieObject *_self;
  3987.     PyObject *_args;
  3988. {
  3989.     PyObject *_res = NULL;
  3990.     TimeValue _rv;
  3991.     if (!PyArg_ParseTuple(_args, ""))
  3992.         return NULL;
  3993.     _rv = GetMovieDuration(_self->ob_itself);
  3994.     _res = Py_BuildValue("l",
  3995.                          _rv);
  3996.     return _res;
  3997. }
  3998.  
  3999. static PyObject *MovieObj_GetMovieRate(_self, _args)
  4000.     MovieObject *_self;
  4001.     PyObject *_args;
  4002. {
  4003.     PyObject *_res = NULL;
  4004.     Fixed _rv;
  4005.     if (!PyArg_ParseTuple(_args, ""))
  4006.         return NULL;
  4007.     _rv = GetMovieRate(_self->ob_itself);
  4008.     _res = Py_BuildValue("O&",
  4009.                          PyMac_BuildFixed, _rv);
  4010.     return _res;
  4011. }
  4012.  
  4013. static PyObject *MovieObj_SetMovieRate(_self, _args)
  4014.     MovieObject *_self;
  4015.     PyObject *_args;
  4016. {
  4017.     PyObject *_res = NULL;
  4018.     Fixed rate;
  4019.     if (!PyArg_ParseTuple(_args, "O&",
  4020.                           PyMac_GetFixed, &rate))
  4021.         return NULL;
  4022.     SetMovieRate(_self->ob_itself,
  4023.                  rate);
  4024.     Py_INCREF(Py_None);
  4025.     _res = Py_None;
  4026.     return _res;
  4027. }
  4028.  
  4029. static PyObject *MovieObj_GetMoviePreferredRate(_self, _args)
  4030.     MovieObject *_self;
  4031.     PyObject *_args;
  4032. {
  4033.     PyObject *_res = NULL;
  4034.     Fixed _rv;
  4035.     if (!PyArg_ParseTuple(_args, ""))
  4036.         return NULL;
  4037.     _rv = GetMoviePreferredRate(_self->ob_itself);
  4038.     _res = Py_BuildValue("O&",
  4039.                          PyMac_BuildFixed, _rv);
  4040.     return _res;
  4041. }
  4042.  
  4043. static PyObject *MovieObj_SetMoviePreferredRate(_self, _args)
  4044.     MovieObject *_self;
  4045.     PyObject *_args;
  4046. {
  4047.     PyObject *_res = NULL;
  4048.     Fixed rate;
  4049.     if (!PyArg_ParseTuple(_args, "O&",
  4050.                           PyMac_GetFixed, &rate))
  4051.         return NULL;
  4052.     SetMoviePreferredRate(_self->ob_itself,
  4053.                           rate);
  4054.     Py_INCREF(Py_None);
  4055.     _res = Py_None;
  4056.     return _res;
  4057. }
  4058.  
  4059. static PyObject *MovieObj_GetMoviePreferredVolume(_self, _args)
  4060.     MovieObject *_self;
  4061.     PyObject *_args;
  4062. {
  4063.     PyObject *_res = NULL;
  4064.     short _rv;
  4065.     if (!PyArg_ParseTuple(_args, ""))
  4066.         return NULL;
  4067.     _rv = GetMoviePreferredVolume(_self->ob_itself);
  4068.     _res = Py_BuildValue("h",
  4069.                          _rv);
  4070.     return _res;
  4071. }
  4072.  
  4073. static PyObject *MovieObj_SetMoviePreferredVolume(_self, _args)
  4074.     MovieObject *_self;
  4075.     PyObject *_args;
  4076. {
  4077.     PyObject *_res = NULL;
  4078.     short volume;
  4079.     if (!PyArg_ParseTuple(_args, "h",
  4080.                           &volume))
  4081.         return NULL;
  4082.     SetMoviePreferredVolume(_self->ob_itself,
  4083.                             volume);
  4084.     Py_INCREF(Py_None);
  4085.     _res = Py_None;
  4086.     return _res;
  4087. }
  4088.  
  4089. static PyObject *MovieObj_GetMovieVolume(_self, _args)
  4090.     MovieObject *_self;
  4091.     PyObject *_args;
  4092. {
  4093.     PyObject *_res = NULL;
  4094.     short _rv;
  4095.     if (!PyArg_ParseTuple(_args, ""))
  4096.         return NULL;
  4097.     _rv = GetMovieVolume(_self->ob_itself);
  4098.     _res = Py_BuildValue("h",
  4099.                          _rv);
  4100.     return _res;
  4101. }
  4102.  
  4103. static PyObject *MovieObj_SetMovieVolume(_self, _args)
  4104.     MovieObject *_self;
  4105.     PyObject *_args;
  4106. {
  4107.     PyObject *_res = NULL;
  4108.     short volume;
  4109.     if (!PyArg_ParseTuple(_args, "h",
  4110.                           &volume))
  4111.         return NULL;
  4112.     SetMovieVolume(_self->ob_itself,
  4113.                    volume);
  4114.     Py_INCREF(Py_None);
  4115.     _res = Py_None;
  4116.     return _res;
  4117. }
  4118.  
  4119. static PyObject *MovieObj_GetMoviePreviewTime(_self, _args)
  4120.     MovieObject *_self;
  4121.     PyObject *_args;
  4122. {
  4123.     PyObject *_res = NULL;
  4124.     TimeValue previewTime;
  4125.     TimeValue previewDuration;
  4126.     if (!PyArg_ParseTuple(_args, ""))
  4127.         return NULL;
  4128.     GetMoviePreviewTime(_self->ob_itself,
  4129.                         &previewTime,
  4130.                         &previewDuration);
  4131.     _res = Py_BuildValue("ll",
  4132.                          previewTime,
  4133.                          previewDuration);
  4134.     return _res;
  4135. }
  4136.  
  4137. static PyObject *MovieObj_SetMoviePreviewTime(_self, _args)
  4138.     MovieObject *_self;
  4139.     PyObject *_args;
  4140. {
  4141.     PyObject *_res = NULL;
  4142.     TimeValue previewTime;
  4143.     TimeValue previewDuration;
  4144.     if (!PyArg_ParseTuple(_args, "ll",
  4145.                           &previewTime,
  4146.                           &previewDuration))
  4147.         return NULL;
  4148.     SetMoviePreviewTime(_self->ob_itself,
  4149.                         previewTime,
  4150.                         previewDuration);
  4151.     Py_INCREF(Py_None);
  4152.     _res = Py_None;
  4153.     return _res;
  4154. }
  4155.  
  4156. static PyObject *MovieObj_GetMoviePosterTime(_self, _args)
  4157.     MovieObject *_self;
  4158.     PyObject *_args;
  4159. {
  4160.     PyObject *_res = NULL;
  4161.     TimeValue _rv;
  4162.     if (!PyArg_ParseTuple(_args, ""))
  4163.         return NULL;
  4164.     _rv = GetMoviePosterTime(_self->ob_itself);
  4165.     _res = Py_BuildValue("l",
  4166.                          _rv);
  4167.     return _res;
  4168. }
  4169.  
  4170. static PyObject *MovieObj_SetMoviePosterTime(_self, _args)
  4171.     MovieObject *_self;
  4172.     PyObject *_args;
  4173. {
  4174.     PyObject *_res = NULL;
  4175.     TimeValue posterTime;
  4176.     if (!PyArg_ParseTuple(_args, "l",
  4177.                           &posterTime))
  4178.         return NULL;
  4179.     SetMoviePosterTime(_self->ob_itself,
  4180.                        posterTime);
  4181.     Py_INCREF(Py_None);
  4182.     _res = Py_None;
  4183.     return _res;
  4184. }
  4185.  
  4186. static PyObject *MovieObj_GetMovieSelection(_self, _args)
  4187.     MovieObject *_self;
  4188.     PyObject *_args;
  4189. {
  4190.     PyObject *_res = NULL;
  4191.     TimeValue selectionTime;
  4192.     TimeValue selectionDuration;
  4193.     if (!PyArg_ParseTuple(_args, ""))
  4194.         return NULL;
  4195.     GetMovieSelection(_self->ob_itself,
  4196.                       &selectionTime,
  4197.                       &selectionDuration);
  4198.     _res = Py_BuildValue("ll",
  4199.                          selectionTime,
  4200.                          selectionDuration);
  4201.     return _res;
  4202. }
  4203.  
  4204. static PyObject *MovieObj_SetMovieSelection(_self, _args)
  4205.     MovieObject *_self;
  4206.     PyObject *_args;
  4207. {
  4208.     PyObject *_res = NULL;
  4209.     TimeValue selectionTime;
  4210.     TimeValue selectionDuration;
  4211.     if (!PyArg_ParseTuple(_args, "ll",
  4212.                           &selectionTime,
  4213.                           &selectionDuration))
  4214.         return NULL;
  4215.     SetMovieSelection(_self->ob_itself,
  4216.                       selectionTime,
  4217.                       selectionDuration);
  4218.     Py_INCREF(Py_None);
  4219.     _res = Py_None;
  4220.     return _res;
  4221. }
  4222.  
  4223. static PyObject *MovieObj_SetMovieActiveSegment(_self, _args)
  4224.     MovieObject *_self;
  4225.     PyObject *_args;
  4226. {
  4227.     PyObject *_res = NULL;
  4228.     TimeValue startTime;
  4229.     TimeValue duration;
  4230.     if (!PyArg_ParseTuple(_args, "ll",
  4231.                           &startTime,
  4232.                           &duration))
  4233.         return NULL;
  4234.     SetMovieActiveSegment(_self->ob_itself,
  4235.                           startTime,
  4236.                           duration);
  4237.     Py_INCREF(Py_None);
  4238.     _res = Py_None;
  4239.     return _res;
  4240. }
  4241.  
  4242. static PyObject *MovieObj_GetMovieActiveSegment(_self, _args)
  4243.     MovieObject *_self;
  4244.     PyObject *_args;
  4245. {
  4246.     PyObject *_res = NULL;
  4247.     TimeValue startTime;
  4248.     TimeValue duration;
  4249.     if (!PyArg_ParseTuple(_args, ""))
  4250.         return NULL;
  4251.     GetMovieActiveSegment(_self->ob_itself,
  4252.                           &startTime,
  4253.                           &duration);
  4254.     _res = Py_BuildValue("ll",
  4255.                          startTime,
  4256.                          duration);
  4257.     return _res;
  4258. }
  4259.  
  4260. static PyObject *MovieObj_SetMovieTimeValue(_self, _args)
  4261.     MovieObject *_self;
  4262.     PyObject *_args;
  4263. {
  4264.     PyObject *_res = NULL;
  4265.     TimeValue newtime;
  4266.     if (!PyArg_ParseTuple(_args, "l",
  4267.                           &newtime))
  4268.         return NULL;
  4269.     SetMovieTimeValue(_self->ob_itself,
  4270.                       newtime);
  4271.     Py_INCREF(Py_None);
  4272.     _res = Py_None;
  4273.     return _res;
  4274. }
  4275.  
  4276. static PyObject *MovieObj_GetMovieUserData(_self, _args)
  4277.     MovieObject *_self;
  4278.     PyObject *_args;
  4279. {
  4280.     PyObject *_res = NULL;
  4281.     UserData _rv;
  4282.     if (!PyArg_ParseTuple(_args, ""))
  4283.         return NULL;
  4284.     _rv = GetMovieUserData(_self->ob_itself);
  4285.     _res = Py_BuildValue("O&",
  4286.                          UserDataObj_New, _rv);
  4287.     return _res;
  4288. }
  4289.  
  4290. static PyObject *MovieObj_GetMovieTrackCount(_self, _args)
  4291.     MovieObject *_self;
  4292.     PyObject *_args;
  4293. {
  4294.     PyObject *_res = NULL;
  4295.     long _rv;
  4296.     if (!PyArg_ParseTuple(_args, ""))
  4297.         return NULL;
  4298.     _rv = GetMovieTrackCount(_self->ob_itself);
  4299.     _res = Py_BuildValue("l",
  4300.                          _rv);
  4301.     return _res;
  4302. }
  4303.  
  4304. static PyObject *MovieObj_GetMovieTrack(_self, _args)
  4305.     MovieObject *_self;
  4306.     PyObject *_args;
  4307. {
  4308.     PyObject *_res = NULL;
  4309.     Track _rv;
  4310.     long trackID;
  4311.     if (!PyArg_ParseTuple(_args, "l",
  4312.                           &trackID))
  4313.         return NULL;
  4314.     _rv = GetMovieTrack(_self->ob_itself,
  4315.                         trackID);
  4316.     _res = Py_BuildValue("O&",
  4317.                          TrackObj_New, _rv);
  4318.     return _res;
  4319. }
  4320.  
  4321. static PyObject *MovieObj_GetMovieIndTrack(_self, _args)
  4322.     MovieObject *_self;
  4323.     PyObject *_args;
  4324. {
  4325.     PyObject *_res = NULL;
  4326.     Track _rv;
  4327.     long index;
  4328.     if (!PyArg_ParseTuple(_args, "l",
  4329.                           &index))
  4330.         return NULL;
  4331.     _rv = GetMovieIndTrack(_self->ob_itself,
  4332.                            index);
  4333.     _res = Py_BuildValue("O&",
  4334.                          TrackObj_New, _rv);
  4335.     return _res;
  4336. }
  4337.  
  4338. static PyObject *MovieObj_GetMovieIndTrackType(_self, _args)
  4339.     MovieObject *_self;
  4340.     PyObject *_args;
  4341. {
  4342.     PyObject *_res = NULL;
  4343.     Track _rv;
  4344.     long index;
  4345.     OSType trackType;
  4346.     long flags;
  4347.     if (!PyArg_ParseTuple(_args, "lO&l",
  4348.                           &index,
  4349.                           PyMac_GetOSType, &trackType,
  4350.                           &flags))
  4351.         return NULL;
  4352.     _rv = GetMovieIndTrackType(_self->ob_itself,
  4353.                                index,
  4354.                                trackType,
  4355.                                flags);
  4356.     _res = Py_BuildValue("O&",
  4357.                          TrackObj_New, _rv);
  4358.     return _res;
  4359. }
  4360.  
  4361. static PyObject *MovieObj_NewMovieTrack(_self, _args)
  4362.     MovieObject *_self;
  4363.     PyObject *_args;
  4364. {
  4365.     PyObject *_res = NULL;
  4366.     Track _rv;
  4367.     Fixed width;
  4368.     Fixed height;
  4369.     short trackVolume;
  4370.     if (!PyArg_ParseTuple(_args, "O&O&h",
  4371.                           PyMac_GetFixed, &width,
  4372.                           PyMac_GetFixed, &height,
  4373.                           &trackVolume))
  4374.         return NULL;
  4375.     _rv = NewMovieTrack(_self->ob_itself,
  4376.                         width,
  4377.                         height,
  4378.                         trackVolume);
  4379.     _res = Py_BuildValue("O&",
  4380.                          TrackObj_New, _rv);
  4381.     return _res;
  4382. }
  4383.  
  4384. static PyObject *MovieObj_SetAutoTrackAlternatesEnabled(_self, _args)
  4385.     MovieObject *_self;
  4386.     PyObject *_args;
  4387. {
  4388.     PyObject *_res = NULL;
  4389.     Boolean enable;
  4390.     if (!PyArg_ParseTuple(_args, "b",
  4391.                           &enable))
  4392.         return NULL;
  4393.     SetAutoTrackAlternatesEnabled(_self->ob_itself,
  4394.                                   enable);
  4395.     Py_INCREF(Py_None);
  4396.     _res = Py_None;
  4397.     return _res;
  4398. }
  4399.  
  4400. static PyObject *MovieObj_SelectMovieAlternates(_self, _args)
  4401.     MovieObject *_self;
  4402.     PyObject *_args;
  4403. {
  4404.     PyObject *_res = NULL;
  4405.     if (!PyArg_ParseTuple(_args, ""))
  4406.         return NULL;
  4407.     SelectMovieAlternates(_self->ob_itself);
  4408.     Py_INCREF(Py_None);
  4409.     _res = Py_None;
  4410.     return _res;
  4411. }
  4412.  
  4413. static PyObject *MovieObj_InsertMovieSegment(_self, _args)
  4414.     MovieObject *_self;
  4415.     PyObject *_args;
  4416. {
  4417.     PyObject *_res = NULL;
  4418.     OSErr _err;
  4419.     Movie dstMovie;
  4420.     TimeValue srcIn;
  4421.     TimeValue srcDuration;
  4422.     TimeValue dstIn;
  4423.     if (!PyArg_ParseTuple(_args, "O&lll",
  4424.                           MovieObj_Convert, &dstMovie,
  4425.                           &srcIn,
  4426.                           &srcDuration,
  4427.                           &dstIn))
  4428.         return NULL;
  4429.     _err = InsertMovieSegment(_self->ob_itself,
  4430.                               dstMovie,
  4431.                               srcIn,
  4432.                               srcDuration,
  4433.                               dstIn);
  4434.     if (_err != noErr) return PyMac_Error(_err);
  4435.     Py_INCREF(Py_None);
  4436.     _res = Py_None;
  4437.     return _res;
  4438. }
  4439.  
  4440. static PyObject *MovieObj_InsertEmptyMovieSegment(_self, _args)
  4441.     MovieObject *_self;
  4442.     PyObject *_args;
  4443. {
  4444.     PyObject *_res = NULL;
  4445.     OSErr _err;
  4446.     TimeValue dstIn;
  4447.     TimeValue dstDuration;
  4448.     if (!PyArg_ParseTuple(_args, "ll",
  4449.                           &dstIn,
  4450.                           &dstDuration))
  4451.         return NULL;
  4452.     _err = InsertEmptyMovieSegment(_self->ob_itself,
  4453.                                    dstIn,
  4454.                                    dstDuration);
  4455.     if (_err != noErr) return PyMac_Error(_err);
  4456.     Py_INCREF(Py_None);
  4457.     _res = Py_None;
  4458.     return _res;
  4459. }
  4460.  
  4461. static PyObject *MovieObj_DeleteMovieSegment(_self, _args)
  4462.     MovieObject *_self;
  4463.     PyObject *_args;
  4464. {
  4465.     PyObject *_res = NULL;
  4466.     OSErr _err;
  4467.     TimeValue startTime;
  4468.     TimeValue duration;
  4469.     if (!PyArg_ParseTuple(_args, "ll",
  4470.                           &startTime,
  4471.                           &duration))
  4472.         return NULL;
  4473.     _err = DeleteMovieSegment(_self->ob_itself,
  4474.                               startTime,
  4475.                               duration);
  4476.     if (_err != noErr) return PyMac_Error(_err);
  4477.     Py_INCREF(Py_None);
  4478.     _res = Py_None;
  4479.     return _res;
  4480. }
  4481.  
  4482. static PyObject *MovieObj_ScaleMovieSegment(_self, _args)
  4483.     MovieObject *_self;
  4484.     PyObject *_args;
  4485. {
  4486.     PyObject *_res = NULL;
  4487.     OSErr _err;
  4488.     TimeValue startTime;
  4489.     TimeValue oldDuration;
  4490.     TimeValue newDuration;
  4491.     if (!PyArg_ParseTuple(_args, "lll",
  4492.                           &startTime,
  4493.                           &oldDuration,
  4494.                           &newDuration))
  4495.         return NULL;
  4496.     _err = ScaleMovieSegment(_self->ob_itself,
  4497.                              startTime,
  4498.                              oldDuration,
  4499.                              newDuration);
  4500.     if (_err != noErr) return PyMac_Error(_err);
  4501.     Py_INCREF(Py_None);
  4502.     _res = Py_None;
  4503.     return _res;
  4504. }
  4505.  
  4506. static PyObject *MovieObj_CutMovieSelection(_self, _args)
  4507.     MovieObject *_self;
  4508.     PyObject *_args;
  4509. {
  4510.     PyObject *_res = NULL;
  4511.     Movie _rv;
  4512.     if (!PyArg_ParseTuple(_args, ""))
  4513.         return NULL;
  4514.     _rv = CutMovieSelection(_self->ob_itself);
  4515.     _res = Py_BuildValue("O&",
  4516.                          MovieObj_New, _rv);
  4517.     return _res;
  4518. }
  4519.  
  4520. static PyObject *MovieObj_CopyMovieSelection(_self, _args)
  4521.     MovieObject *_self;
  4522.     PyObject *_args;
  4523. {
  4524.     PyObject *_res = NULL;
  4525.     Movie _rv;
  4526.     if (!PyArg_ParseTuple(_args, ""))
  4527.         return NULL;
  4528.     _rv = CopyMovieSelection(_self->ob_itself);
  4529.     _res = Py_BuildValue("O&",
  4530.                          MovieObj_New, _rv);
  4531.     return _res;
  4532. }
  4533.  
  4534. static PyObject *MovieObj_PasteMovieSelection(_self, _args)
  4535.     MovieObject *_self;
  4536.     PyObject *_args;
  4537. {
  4538.     PyObject *_res = NULL;
  4539.     Movie src;
  4540.     if (!PyArg_ParseTuple(_args, "O&",
  4541.                           MovieObj_Convert, &src))
  4542.         return NULL;
  4543.     PasteMovieSelection(_self->ob_itself,
  4544.                         src);
  4545.     Py_INCREF(Py_None);
  4546.     _res = Py_None;
  4547.     return _res;
  4548. }
  4549.  
  4550. static PyObject *MovieObj_AddMovieSelection(_self, _args)
  4551.     MovieObject *_self;
  4552.     PyObject *_args;
  4553. {
  4554.     PyObject *_res = NULL;
  4555.     Movie src;
  4556.     if (!PyArg_ParseTuple(_args, "O&",
  4557.                           MovieObj_Convert, &src))
  4558.         return NULL;
  4559.     AddMovieSelection(_self->ob_itself,
  4560.                       src);
  4561.     Py_INCREF(Py_None);
  4562.     _res = Py_None;
  4563.     return _res;
  4564. }
  4565.  
  4566. static PyObject *MovieObj_ClearMovieSelection(_self, _args)
  4567.     MovieObject *_self;
  4568.     PyObject *_args;
  4569. {
  4570.     PyObject *_res = NULL;
  4571.     if (!PyArg_ParseTuple(_args, ""))
  4572.         return NULL;
  4573.     ClearMovieSelection(_self->ob_itself);
  4574.     Py_INCREF(Py_None);
  4575.     _res = Py_None;
  4576.     return _res;
  4577. }
  4578.  
  4579. static PyObject *MovieObj_PutMovieIntoTypedHandle(_self, _args)
  4580.     MovieObject *_self;
  4581.     PyObject *_args;
  4582. {
  4583.     PyObject *_res = NULL;
  4584.     OSErr _err;
  4585.     Track targetTrack;
  4586.     OSType handleType;
  4587.     Handle publicMovie;
  4588.     TimeValue start;
  4589.     TimeValue dur;
  4590.     long flags;
  4591.     ComponentInstance userComp;
  4592.     if (!PyArg_ParseTuple(_args, "O&O&O&lllO&",
  4593.                           TrackObj_Convert, &targetTrack,
  4594.                           PyMac_GetOSType, &handleType,
  4595.                           ResObj_Convert, &publicMovie,
  4596.                           &start,
  4597.                           &dur,
  4598.                           &flags,
  4599.                           CmpInstObj_Convert, &userComp))
  4600.         return NULL;
  4601.     _err = PutMovieIntoTypedHandle(_self->ob_itself,
  4602.                                    targetTrack,
  4603.                                    handleType,
  4604.                                    publicMovie,
  4605.                                    start,
  4606.                                    dur,
  4607.                                    flags,
  4608.                                    userComp);
  4609.     if (_err != noErr) return PyMac_Error(_err);
  4610.     Py_INCREF(Py_None);
  4611.     _res = Py_None;
  4612.     return _res;
  4613. }
  4614.  
  4615. static PyObject *MovieObj_CopyMovieSettings(_self, _args)
  4616.     MovieObject *_self;
  4617.     PyObject *_args;
  4618. {
  4619.     PyObject *_res = NULL;
  4620.     OSErr _err;
  4621.     Movie dstMovie;
  4622.     if (!PyArg_ParseTuple(_args, "O&",
  4623.                           MovieObj_Convert, &dstMovie))
  4624.         return NULL;
  4625.     _err = CopyMovieSettings(_self->ob_itself,
  4626.                              dstMovie);
  4627.     if (_err != noErr) return PyMac_Error(_err);
  4628.     Py_INCREF(Py_None);
  4629.     _res = Py_None;
  4630.     return _res;
  4631. }
  4632.  
  4633. static PyObject *MovieObj_ConvertMovieToFile(_self, _args)
  4634.     MovieObject *_self;
  4635.     PyObject *_args;
  4636. {
  4637.     PyObject *_res = NULL;
  4638.     OSErr _err;
  4639.     Track onlyTrack;
  4640.     FSSpec outputFile;
  4641.     OSType fileType;
  4642.     OSType creator;
  4643.     ScriptCode scriptTag;
  4644.     short resID;
  4645.     long flags;
  4646.     ComponentInstance userComp;
  4647.     if (!PyArg_ParseTuple(_args, "O&O&O&O&hlO&",
  4648.                           TrackObj_Convert, &onlyTrack,
  4649.                           PyMac_GetFSSpec, &outputFile,
  4650.                           PyMac_GetOSType, &fileType,
  4651.                           PyMac_GetOSType, &creator,
  4652.                           &scriptTag,
  4653.                           &flags,
  4654.                           CmpInstObj_Convert, &userComp))
  4655.         return NULL;
  4656.     _err = ConvertMovieToFile(_self->ob_itself,
  4657.                               onlyTrack,
  4658.                               &outputFile,
  4659.                               fileType,
  4660.                               creator,
  4661.                               scriptTag,
  4662.                               &resID,
  4663.                               flags,
  4664.                               userComp);
  4665.     if (_err != noErr) return PyMac_Error(_err);
  4666.     _res = Py_BuildValue("h",
  4667.                          resID);
  4668.     return _res;
  4669. }
  4670.  
  4671. static PyObject *MovieObj_GetMovieDataSize(_self, _args)
  4672.     MovieObject *_self;
  4673.     PyObject *_args;
  4674. {
  4675.     PyObject *_res = NULL;
  4676.     long _rv;
  4677.     TimeValue startTime;
  4678.     TimeValue duration;
  4679.     if (!PyArg_ParseTuple(_args, "ll",
  4680.                           &startTime,
  4681.                           &duration))
  4682.         return NULL;
  4683.     _rv = GetMovieDataSize(_self->ob_itself,
  4684.                            startTime,
  4685.                            duration);
  4686.     _res = Py_BuildValue("l",
  4687.                          _rv);
  4688.     return _res;
  4689. }
  4690.  
  4691. static PyObject *MovieObj_PtInMovie(_self, _args)
  4692.     MovieObject *_self;
  4693.     PyObject *_args;
  4694. {
  4695.     PyObject *_res = NULL;
  4696.     Boolean _rv;
  4697.     Point pt;
  4698.     if (!PyArg_ParseTuple(_args, "O&",
  4699.                           PyMac_GetPoint, &pt))
  4700.         return NULL;
  4701.     _rv = PtInMovie(_self->ob_itself,
  4702.                     pt);
  4703.     _res = Py_BuildValue("b",
  4704.                          _rv);
  4705.     return _res;
  4706. }
  4707.  
  4708. static PyObject *MovieObj_SetMovieLanguage(_self, _args)
  4709.     MovieObject *_self;
  4710.     PyObject *_args;
  4711. {
  4712.     PyObject *_res = NULL;
  4713.     long language;
  4714.     if (!PyArg_ParseTuple(_args, "l",
  4715.                           &language))
  4716.         return NULL;
  4717.     SetMovieLanguage(_self->ob_itself,
  4718.                      language);
  4719.     Py_INCREF(Py_None);
  4720.     _res = Py_None;
  4721.     return _res;
  4722. }
  4723.  
  4724. static PyObject *MovieObj_GetMovieNextInterestingTime(_self, _args)
  4725.     MovieObject *_self;
  4726.     PyObject *_args;
  4727. {
  4728.     PyObject *_res = NULL;
  4729.     short interestingTimeFlags;
  4730.     short numMediaTypes;
  4731.     OSType whichMediaTypes;
  4732.     TimeValue time;
  4733.     Fixed rate;
  4734.     TimeValue interestingTime;
  4735.     TimeValue interestingDuration;
  4736.     if (!PyArg_ParseTuple(_args, "hhO&lO&",
  4737.                           &interestingTimeFlags,
  4738.                           &numMediaTypes,
  4739.                           PyMac_GetOSType, &whichMediaTypes,
  4740.                           &time,
  4741.                           PyMac_GetFixed, &rate))
  4742.         return NULL;
  4743.     GetMovieNextInterestingTime(_self->ob_itself,
  4744.                                 interestingTimeFlags,
  4745.                                 numMediaTypes,
  4746.                                 &whichMediaTypes,
  4747.                                 time,
  4748.                                 rate,
  4749.                                 &interestingTime,
  4750.                                 &interestingDuration);
  4751.     _res = Py_BuildValue("ll",
  4752.                          interestingTime,
  4753.                          interestingDuration);
  4754.     return _res;
  4755. }
  4756.  
  4757. static PyObject *MovieObj_AddMovieResource(_self, _args)
  4758.     MovieObject *_self;
  4759.     PyObject *_args;
  4760. {
  4761.     PyObject *_res = NULL;
  4762.     OSErr _err;
  4763.     short resRefNum;
  4764.     short resId;
  4765.     Str255 resName;
  4766.     if (!PyArg_ParseTuple(_args, "hO&",
  4767.                           &resRefNum,
  4768.                           PyMac_GetStr255, resName))
  4769.         return NULL;
  4770.     _err = AddMovieResource(_self->ob_itself,
  4771.                             resRefNum,
  4772.                             &resId,
  4773.                             resName);
  4774.     if (_err != noErr) return PyMac_Error(_err);
  4775.     _res = Py_BuildValue("h",
  4776.                          resId);
  4777.     return _res;
  4778. }
  4779.  
  4780. static PyObject *MovieObj_UpdateMovieResource(_self, _args)
  4781.     MovieObject *_self;
  4782.     PyObject *_args;
  4783. {
  4784.     PyObject *_res = NULL;
  4785.     OSErr _err;
  4786.     short resRefNum;
  4787.     short resId;
  4788.     Str255 resName;
  4789.     if (!PyArg_ParseTuple(_args, "hhO&",
  4790.                           &resRefNum,
  4791.                           &resId,
  4792.                           PyMac_GetStr255, resName))
  4793.         return NULL;
  4794.     _err = UpdateMovieResource(_self->ob_itself,
  4795.                                resRefNum,
  4796.                                resId,
  4797.                                resName);
  4798.     if (_err != noErr) return PyMac_Error(_err);
  4799.     Py_INCREF(Py_None);
  4800.     _res = Py_None;
  4801.     return _res;
  4802. }
  4803.  
  4804. static PyObject *MovieObj_HasMovieChanged(_self, _args)
  4805.     MovieObject *_self;
  4806.     PyObject *_args;
  4807. {
  4808.     PyObject *_res = NULL;
  4809.     Boolean _rv;
  4810.     if (!PyArg_ParseTuple(_args, ""))
  4811.         return NULL;
  4812.     _rv = HasMovieChanged(_self->ob_itself);
  4813.     _res = Py_BuildValue("b",
  4814.                          _rv);
  4815.     return _res;
  4816. }
  4817.  
  4818. static PyObject *MovieObj_ClearMovieChanged(_self, _args)
  4819.     MovieObject *_self;
  4820.     PyObject *_args;
  4821. {
  4822.     PyObject *_res = NULL;
  4823.     if (!PyArg_ParseTuple(_args, ""))
  4824.         return NULL;
  4825.     ClearMovieChanged(_self->ob_itself);
  4826.     Py_INCREF(Py_None);
  4827.     _res = Py_None;
  4828.     return _res;
  4829. }
  4830.  
  4831. static PyObject *MovieObj_SetMovieDefaultDataRef(_self, _args)
  4832.     MovieObject *_self;
  4833.     PyObject *_args;
  4834. {
  4835.     PyObject *_res = NULL;
  4836.     OSErr _err;
  4837.     Handle dataRef;
  4838.     OSType dataRefType;
  4839.     if (!PyArg_ParseTuple(_args, "O&O&",
  4840.                           ResObj_Convert, &dataRef,
  4841.                           PyMac_GetOSType, &dataRefType))
  4842.         return NULL;
  4843.     _err = SetMovieDefaultDataRef(_self->ob_itself,
  4844.                                   dataRef,
  4845.                                   dataRefType);
  4846.     if (_err != noErr) return PyMac_Error(_err);
  4847.     Py_INCREF(Py_None);
  4848.     _res = Py_None;
  4849.     return _res;
  4850. }
  4851.  
  4852. static PyObject *MovieObj_GetMovieDefaultDataRef(_self, _args)
  4853.     MovieObject *_self;
  4854.     PyObject *_args;
  4855. {
  4856.     PyObject *_res = NULL;
  4857.     OSErr _err;
  4858.     Handle dataRef;
  4859.     OSType dataRefType;
  4860.     if (!PyArg_ParseTuple(_args, ""))
  4861.         return NULL;
  4862.     _err = GetMovieDefaultDataRef(_self->ob_itself,
  4863.                                   &dataRef,
  4864.                                   &dataRefType);
  4865.     if (_err != noErr) return PyMac_Error(_err);
  4866.     _res = Py_BuildValue("O&O&",
  4867.                          ResObj_New, dataRef,
  4868.                          PyMac_BuildOSType, dataRefType);
  4869.     return _res;
  4870. }
  4871.  
  4872. static PyObject *MovieObj_SetMovieColorTable(_self, _args)
  4873.     MovieObject *_self;
  4874.     PyObject *_args;
  4875. {
  4876.     PyObject *_res = NULL;
  4877.     OSErr _err;
  4878.     CTabHandle ctab;
  4879.     if (!PyArg_ParseTuple(_args, "O&",
  4880.                           ResObj_Convert, &ctab))
  4881.         return NULL;
  4882.     _err = SetMovieColorTable(_self->ob_itself,
  4883.                               ctab);
  4884.     if (_err != noErr) return PyMac_Error(_err);
  4885.     Py_INCREF(Py_None);
  4886.     _res = Py_None;
  4887.     return _res;
  4888. }
  4889.  
  4890. static PyObject *MovieObj_GetMovieColorTable(_self, _args)
  4891.     MovieObject *_self;
  4892.     PyObject *_args;
  4893. {
  4894.     PyObject *_res = NULL;
  4895.     OSErr _err;
  4896.     CTabHandle ctab;
  4897.     if (!PyArg_ParseTuple(_args, ""))
  4898.         return NULL;
  4899.     _err = GetMovieColorTable(_self->ob_itself,
  4900.                               &ctab);
  4901.     if (_err != noErr) return PyMac_Error(_err);
  4902.     _res = Py_BuildValue("O&",
  4903.                          ResObj_New, ctab);
  4904.     return _res;
  4905. }
  4906.  
  4907. static PyObject *MovieObj_FlattenMovie(_self, _args)
  4908.     MovieObject *_self;
  4909.     PyObject *_args;
  4910. {
  4911.     PyObject *_res = NULL;
  4912.     long movieFlattenFlags;
  4913.     FSSpec theFile;
  4914.     OSType creator;
  4915.     ScriptCode scriptTag;
  4916.     long createMovieFileFlags;
  4917.     short resId;
  4918.     Str255 resName;
  4919.     if (!PyArg_ParseTuple(_args, "lO&O&hlO&",
  4920.                           &movieFlattenFlags,
  4921.                           PyMac_GetFSSpec, &theFile,
  4922.                           PyMac_GetOSType, &creator,
  4923.                           &scriptTag,
  4924.                           &createMovieFileFlags,
  4925.                           PyMac_GetStr255, resName))
  4926.         return NULL;
  4927.     FlattenMovie(_self->ob_itself,
  4928.                  movieFlattenFlags,
  4929.                  &theFile,
  4930.                  creator,
  4931.                  scriptTag,
  4932.                  createMovieFileFlags,
  4933.                  &resId,
  4934.                  resName);
  4935.     _res = Py_BuildValue("h",
  4936.                          resId);
  4937.     return _res;
  4938. }
  4939.  
  4940. static PyObject *MovieObj_FlattenMovieData(_self, _args)
  4941.     MovieObject *_self;
  4942.     PyObject *_args;
  4943. {
  4944.     PyObject *_res = NULL;
  4945.     Movie _rv;
  4946.     long movieFlattenFlags;
  4947.     FSSpec theFile;
  4948.     OSType creator;
  4949.     ScriptCode scriptTag;
  4950.     long createMovieFileFlags;
  4951.     if (!PyArg_ParseTuple(_args, "lO&O&hl",
  4952.                           &movieFlattenFlags,
  4953.                           PyMac_GetFSSpec, &theFile,
  4954.                           PyMac_GetOSType, &creator,
  4955.                           &scriptTag,
  4956.                           &createMovieFileFlags))
  4957.         return NULL;
  4958.     _rv = FlattenMovieData(_self->ob_itself,
  4959.                            movieFlattenFlags,
  4960.                            &theFile,
  4961.                            creator,
  4962.                            scriptTag,
  4963.                            createMovieFileFlags);
  4964.     _res = Py_BuildValue("O&",
  4965.                          MovieObj_New, _rv);
  4966.     return _res;
  4967. }
  4968.  
  4969. static PyObject *MovieObj_MovieSearchText(_self, _args)
  4970.     MovieObject *_self;
  4971.     PyObject *_args;
  4972. {
  4973.     PyObject *_res = NULL;
  4974.     OSErr _err;
  4975.     Ptr text;
  4976.     long size;
  4977.     long searchFlags;
  4978.     Track searchTrack;
  4979.     TimeValue searchTime;
  4980.     long searchOffset;
  4981.     if (!PyArg_ParseTuple(_args, "sll",
  4982.                           &text,
  4983.                           &size,
  4984.                           &searchFlags))
  4985.         return NULL;
  4986.     _err = MovieSearchText(_self->ob_itself,
  4987.                            text,
  4988.                            size,
  4989.                            searchFlags,
  4990.                            &searchTrack,
  4991.                            &searchTime,
  4992.                            &searchOffset);
  4993.     if (_err != noErr) return PyMac_Error(_err);
  4994.     _res = Py_BuildValue("O&ll",
  4995.                          TrackObj_New, searchTrack,
  4996.                          searchTime,
  4997.                          searchOffset);
  4998.     return _res;
  4999. }
  5000.  
  5001. static PyObject *MovieObj_GetPosterBox(_self, _args)
  5002.     MovieObject *_self;
  5003.     PyObject *_args;
  5004. {
  5005.     PyObject *_res = NULL;
  5006.     Rect boxRect;
  5007.     if (!PyArg_ParseTuple(_args, ""))
  5008.         return NULL;
  5009.     GetPosterBox(_self->ob_itself,
  5010.                  &boxRect);
  5011.     _res = Py_BuildValue("O&",
  5012.                          PyMac_BuildRect, &boxRect);
  5013.     return _res;
  5014. }
  5015.  
  5016. static PyObject *MovieObj_SetPosterBox(_self, _args)
  5017.     MovieObject *_self;
  5018.     PyObject *_args;
  5019. {
  5020.     PyObject *_res = NULL;
  5021.     Rect boxRect;
  5022.     if (!PyArg_ParseTuple(_args, "O&",
  5023.                           PyMac_GetRect, &boxRect))
  5024.         return NULL;
  5025.     SetPosterBox(_self->ob_itself,
  5026.                  &boxRect);
  5027.     Py_INCREF(Py_None);
  5028.     _res = Py_None;
  5029.     return _res;
  5030. }
  5031.  
  5032. static PyObject *MovieObj_GetMovieSegmentDisplayBoundsRgn(_self, _args)
  5033.     MovieObject *_self;
  5034.     PyObject *_args;
  5035. {
  5036.     PyObject *_res = NULL;
  5037.     RgnHandle _rv;
  5038.     TimeValue time;
  5039.     TimeValue duration;
  5040.     if (!PyArg_ParseTuple(_args, "ll",
  5041.                           &time,
  5042.                           &duration))
  5043.         return NULL;
  5044.     _rv = GetMovieSegmentDisplayBoundsRgn(_self->ob_itself,
  5045.                                           time,
  5046.                                           duration);
  5047.     _res = Py_BuildValue("O&",
  5048.                          ResObj_New, _rv);
  5049.     return _res;
  5050. }
  5051.  
  5052. static PyObject *MovieObj_GetMovieStatus(_self, _args)
  5053.     MovieObject *_self;
  5054.     PyObject *_args;
  5055. {
  5056.     PyObject *_res = NULL;
  5057.     ComponentResult _rv;
  5058.     Track firstProblemTrack;
  5059.     if (!PyArg_ParseTuple(_args, ""))
  5060.         return NULL;
  5061.     _rv = GetMovieStatus(_self->ob_itself,
  5062.                          &firstProblemTrack);
  5063.     _res = Py_BuildValue("lO&",
  5064.                          _rv,
  5065.                          TrackObj_New, firstProblemTrack);
  5066.     return _res;
  5067. }
  5068.  
  5069. static PyObject *MovieObj_NewMovieController(_self, _args)
  5070.     MovieObject *_self;
  5071.     PyObject *_args;
  5072. {
  5073.     PyObject *_res = NULL;
  5074.     MovieController _rv;
  5075.     Rect movieRect;
  5076.     long someFlags;
  5077.     if (!PyArg_ParseTuple(_args, "O&l",
  5078.                           PyMac_GetRect, &movieRect,
  5079.                           &someFlags))
  5080.         return NULL;
  5081.     _rv = NewMovieController(_self->ob_itself,
  5082.                              &movieRect,
  5083.                              someFlags);
  5084.     _res = Py_BuildValue("O&",
  5085.                          MovieCtlObj_New, _rv);
  5086.     return _res;
  5087. }
  5088.  
  5089. static PyObject *MovieObj_PutMovieOnScrap(_self, _args)
  5090.     MovieObject *_self;
  5091.     PyObject *_args;
  5092. {
  5093.     PyObject *_res = NULL;
  5094.     OSErr _err;
  5095.     long movieScrapFlags;
  5096.     if (!PyArg_ParseTuple(_args, "l",
  5097.                           &movieScrapFlags))
  5098.         return NULL;
  5099.     _err = PutMovieOnScrap(_self->ob_itself,
  5100.                            movieScrapFlags);
  5101.     if (_err != noErr) return PyMac_Error(_err);
  5102.     Py_INCREF(Py_None);
  5103.     _res = Py_None;
  5104.     return _res;
  5105. }
  5106.  
  5107. static PyObject *MovieObj_SetMoviePlayHints(_self, _args)
  5108.     MovieObject *_self;
  5109.     PyObject *_args;
  5110. {
  5111.     PyObject *_res = NULL;
  5112.     long flags;
  5113.     long flagsMask;
  5114.     if (!PyArg_ParseTuple(_args, "ll",
  5115.                           &flags,
  5116.                           &flagsMask))
  5117.         return NULL;
  5118.     SetMoviePlayHints(_self->ob_itself,
  5119.                       flags,
  5120.                       flagsMask);
  5121.     Py_INCREF(Py_None);
  5122.     _res = Py_None;
  5123.     return _res;
  5124. }
  5125.  
  5126. static PyMethodDef MovieObj_methods[] = {
  5127.     {"MoviesTask", (PyCFunction)MovieObj_MoviesTask, 1,
  5128.      "(long maxMilliSecToUse) -> None"},
  5129.     {"PrerollMovie", (PyCFunction)MovieObj_PrerollMovie, 1,
  5130.      "(TimeValue time, Fixed Rate) -> None"},
  5131.     {"LoadMovieIntoRam", (PyCFunction)MovieObj_LoadMovieIntoRam, 1,
  5132.      "(TimeValue time, TimeValue duration, long flags) -> None"},
  5133.     {"SetMovieActive", (PyCFunction)MovieObj_SetMovieActive, 1,
  5134.      "(Boolean active) -> None"},
  5135.     {"GetMovieActive", (PyCFunction)MovieObj_GetMovieActive, 1,
  5136.      "() -> (Boolean _rv)"},
  5137.     {"StartMovie", (PyCFunction)MovieObj_StartMovie, 1,
  5138.      "() -> None"},
  5139.     {"StopMovie", (PyCFunction)MovieObj_StopMovie, 1,
  5140.      "() -> None"},
  5141.     {"GoToBeginningOfMovie", (PyCFunction)MovieObj_GoToBeginningOfMovie, 1,
  5142.      "() -> None"},
  5143.     {"GoToEndOfMovie", (PyCFunction)MovieObj_GoToEndOfMovie, 1,
  5144.      "() -> None"},
  5145.     {"IsMovieDone", (PyCFunction)MovieObj_IsMovieDone, 1,
  5146.      "() -> (Boolean _rv)"},
  5147.     {"GetMoviePreviewMode", (PyCFunction)MovieObj_GetMoviePreviewMode, 1,
  5148.      "() -> (Boolean _rv)"},
  5149.     {"SetMoviePreviewMode", (PyCFunction)MovieObj_SetMoviePreviewMode, 1,
  5150.      "(Boolean usePreview) -> None"},
  5151.     {"ShowMoviePoster", (PyCFunction)MovieObj_ShowMoviePoster, 1,
  5152.      "() -> None"},
  5153.     {"GetMovieTimeBase", (PyCFunction)MovieObj_GetMovieTimeBase, 1,
  5154.      "() -> (TimeBase _rv)"},
  5155.     {"GetNextTrackForCompositing", (PyCFunction)MovieObj_GetNextTrackForCompositing, 1,
  5156.      "(Track theTrack) -> (Track _rv)"},
  5157.     {"GetPrevTrackForCompositing", (PyCFunction)MovieObj_GetPrevTrackForCompositing, 1,
  5158.      "(Track theTrack) -> (Track _rv)"},
  5159.     {"GetMoviePict", (PyCFunction)MovieObj_GetMoviePict, 1,
  5160.      "(TimeValue time) -> (PicHandle _rv)"},
  5161.     {"GetMoviePosterPict", (PyCFunction)MovieObj_GetMoviePosterPict, 1,
  5162.      "() -> (PicHandle _rv)"},
  5163.     {"UpdateMovie", (PyCFunction)MovieObj_UpdateMovie, 1,
  5164.      "() -> None"},
  5165.     {"GetMovieBox", (PyCFunction)MovieObj_GetMovieBox, 1,
  5166.      "() -> (Rect boxRect)"},
  5167.     {"SetMovieBox", (PyCFunction)MovieObj_SetMovieBox, 1,
  5168.      "(Rect boxRect) -> None"},
  5169.     {"GetMovieDisplayClipRgn", (PyCFunction)MovieObj_GetMovieDisplayClipRgn, 1,
  5170.      "() -> (RgnHandle _rv)"},
  5171.     {"SetMovieDisplayClipRgn", (PyCFunction)MovieObj_SetMovieDisplayClipRgn, 1,
  5172.      "(RgnHandle theClip) -> None"},
  5173.     {"GetMovieClipRgn", (PyCFunction)MovieObj_GetMovieClipRgn, 1,
  5174.      "() -> (RgnHandle _rv)"},
  5175.     {"SetMovieClipRgn", (PyCFunction)MovieObj_SetMovieClipRgn, 1,
  5176.      "(RgnHandle theClip) -> None"},
  5177.     {"GetMovieDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieDisplayBoundsRgn, 1,
  5178.      "() -> (RgnHandle _rv)"},
  5179.     {"GetMovieBoundsRgn", (PyCFunction)MovieObj_GetMovieBoundsRgn, 1,
  5180.      "() -> (RgnHandle _rv)"},
  5181.     {"PutMovieIntoHandle", (PyCFunction)MovieObj_PutMovieIntoHandle, 1,
  5182.      "(Handle publicMovie) -> None"},
  5183.     {"PutMovieIntoDataFork", (PyCFunction)MovieObj_PutMovieIntoDataFork, 1,
  5184.      "(short fRefNum, long offset, long maxSize) -> None"},
  5185.     {"GetMovieTimeScale", (PyCFunction)MovieObj_GetMovieTimeScale, 1,
  5186.      "() -> (TimeScale _rv)"},
  5187.     {"SetMovieTimeScale", (PyCFunction)MovieObj_SetMovieTimeScale, 1,
  5188.      "(TimeScale timeScale) -> None"},
  5189.     {"GetMovieDuration", (PyCFunction)MovieObj_GetMovieDuration, 1,
  5190.      "() -> (TimeValue _rv)"},
  5191.     {"GetMovieRate", (PyCFunction)MovieObj_GetMovieRate, 1,
  5192.      "() -> (Fixed _rv)"},
  5193.     {"SetMovieRate", (PyCFunction)MovieObj_SetMovieRate, 1,
  5194.      "(Fixed rate) -> None"},
  5195.     {"GetMoviePreferredRate", (PyCFunction)MovieObj_GetMoviePreferredRate, 1,
  5196.      "() -> (Fixed _rv)"},
  5197.     {"SetMoviePreferredRate", (PyCFunction)MovieObj_SetMoviePreferredRate, 1,
  5198.      "(Fixed rate) -> None"},
  5199.     {"GetMoviePreferredVolume", (PyCFunction)MovieObj_GetMoviePreferredVolume, 1,
  5200.      "() -> (short _rv)"},
  5201.     {"SetMoviePreferredVolume", (PyCFunction)MovieObj_SetMoviePreferredVolume, 1,
  5202.      "(short volume) -> None"},
  5203.     {"GetMovieVolume", (PyCFunction)MovieObj_GetMovieVolume, 1,
  5204.      "() -> (short _rv)"},
  5205.     {"SetMovieVolume", (PyCFunction)MovieObj_SetMovieVolume, 1,
  5206.      "(short volume) -> None"},
  5207.     {"GetMoviePreviewTime", (PyCFunction)MovieObj_GetMoviePreviewTime, 1,
  5208.      "() -> (TimeValue previewTime, TimeValue previewDuration)"},
  5209.     {"SetMoviePreviewTime", (PyCFunction)MovieObj_SetMoviePreviewTime, 1,
  5210.      "(TimeValue previewTime, TimeValue previewDuration) -> None"},
  5211.     {"GetMoviePosterTime", (PyCFunction)MovieObj_GetMoviePosterTime, 1,
  5212.      "() -> (TimeValue _rv)"},
  5213.     {"SetMoviePosterTime", (PyCFunction)MovieObj_SetMoviePosterTime, 1,
  5214.      "(TimeValue posterTime) -> None"},
  5215.     {"GetMovieSelection", (PyCFunction)MovieObj_GetMovieSelection, 1,
  5216.      "() -> (TimeValue selectionTime, TimeValue selectionDuration)"},
  5217.     {"SetMovieSelection", (PyCFunction)MovieObj_SetMovieSelection, 1,
  5218.      "(TimeValue selectionTime, TimeValue selectionDuration) -> None"},
  5219.     {"SetMovieActiveSegment", (PyCFunction)MovieObj_SetMovieActiveSegment, 1,
  5220.      "(TimeValue startTime, TimeValue duration) -> None"},
  5221.     {"GetMovieActiveSegment", (PyCFunction)MovieObj_GetMovieActiveSegment, 1,
  5222.      "() -> (TimeValue startTime, TimeValue duration)"},
  5223.     {"SetMovieTimeValue", (PyCFunction)MovieObj_SetMovieTimeValue, 1,
  5224.      "(TimeValue newtime) -> None"},
  5225.     {"GetMovieUserData", (PyCFunction)MovieObj_GetMovieUserData, 1,
  5226.      "() -> (UserData _rv)"},
  5227.     {"GetMovieTrackCount", (PyCFunction)MovieObj_GetMovieTrackCount, 1,
  5228.      "() -> (long _rv)"},
  5229.     {"GetMovieTrack", (PyCFunction)MovieObj_GetMovieTrack, 1,
  5230.      "(long trackID) -> (Track _rv)"},
  5231.     {"GetMovieIndTrack", (PyCFunction)MovieObj_GetMovieIndTrack, 1,
  5232.      "(long index) -> (Track _rv)"},
  5233.     {"GetMovieIndTrackType", (PyCFunction)MovieObj_GetMovieIndTrackType, 1,
  5234.      "(long index, OSType trackType, long flags) -> (Track _rv)"},
  5235.     {"NewMovieTrack", (PyCFunction)MovieObj_NewMovieTrack, 1,
  5236.      "(Fixed width, Fixed height, short trackVolume) -> (Track _rv)"},
  5237.     {"SetAutoTrackAlternatesEnabled", (PyCFunction)MovieObj_SetAutoTrackAlternatesEnabled, 1,
  5238.      "(Boolean enable) -> None"},
  5239.     {"SelectMovieAlternates", (PyCFunction)MovieObj_SelectMovieAlternates, 1,
  5240.      "() -> None"},
  5241.     {"InsertMovieSegment", (PyCFunction)MovieObj_InsertMovieSegment, 1,
  5242.      "(Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn) -> None"},
  5243.     {"InsertEmptyMovieSegment", (PyCFunction)MovieObj_InsertEmptyMovieSegment, 1,
  5244.      "(TimeValue dstIn, TimeValue dstDuration) -> None"},
  5245.     {"DeleteMovieSegment", (PyCFunction)MovieObj_DeleteMovieSegment, 1,
  5246.      "(TimeValue startTime, TimeValue duration) -> None"},
  5247.     {"ScaleMovieSegment", (PyCFunction)MovieObj_ScaleMovieSegment, 1,
  5248.      "(TimeValue startTime, TimeValue oldDuration, TimeValue newDuration) -> None"},
  5249.     {"CutMovieSelection", (PyCFunction)MovieObj_CutMovieSelection, 1,
  5250.      "() -> (Movie _rv)"},
  5251.     {"CopyMovieSelection", (PyCFunction)MovieObj_CopyMovieSelection, 1,
  5252.      "() -> (Movie _rv)"},
  5253.     {"PasteMovieSelection", (PyCFunction)MovieObj_PasteMovieSelection, 1,
  5254.      "(Movie src) -> None"},
  5255.     {"AddMovieSelection", (PyCFunction)MovieObj_AddMovieSelection, 1,
  5256.      "(Movie src) -> None"},
  5257.     {"ClearMovieSelection", (PyCFunction)MovieObj_ClearMovieSelection, 1,
  5258.      "() -> None"},
  5259.     {"PutMovieIntoTypedHandle", (PyCFunction)MovieObj_PutMovieIntoTypedHandle, 1,
  5260.      "(Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp) -> None"},
  5261.     {"CopyMovieSettings", (PyCFunction)MovieObj_CopyMovieSettings, 1,
  5262.      "(Movie dstMovie) -> None"},
  5263.     {"ConvertMovieToFile", (PyCFunction)MovieObj_ConvertMovieToFile, 1,
  5264.      "(Track onlyTrack, FSSpec outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, long flags, ComponentInstance userComp) -> (short resID)"},
  5265.     {"GetMovieDataSize", (PyCFunction)MovieObj_GetMovieDataSize, 1,
  5266.      "(TimeValue startTime, TimeValue duration) -> (long _rv)"},
  5267.     {"PtInMovie", (PyCFunction)MovieObj_PtInMovie, 1,
  5268.      "(Point pt) -> (Boolean _rv)"},
  5269.     {"SetMovieLanguage", (PyCFunction)MovieObj_SetMovieLanguage, 1,
  5270.      "(long language) -> None"},
  5271.     {"GetMovieNextInterestingTime", (PyCFunction)MovieObj_GetMovieNextInterestingTime, 1,
  5272.      "(short interestingTimeFlags, short numMediaTypes, OSType whichMediaTypes, TimeValue time, Fixed rate) -> (TimeValue interestingTime, TimeValue interestingDuration)"},
  5273.     {"AddMovieResource", (PyCFunction)MovieObj_AddMovieResource, 1,
  5274.      "(short resRefNum, Str255 resName) -> (short resId)"},
  5275.     {"UpdateMovieResource", (PyCFunction)MovieObj_UpdateMovieResource, 1,
  5276.      "(short resRefNum, short resId, Str255 resName) -> None"},
  5277.     {"HasMovieChanged", (PyCFunction)MovieObj_HasMovieChanged, 1,
  5278.      "() -> (Boolean _rv)"},
  5279.     {"ClearMovieChanged", (PyCFunction)MovieObj_ClearMovieChanged, 1,
  5280.      "() -> None"},
  5281.     {"SetMovieDefaultDataRef", (PyCFunction)MovieObj_SetMovieDefaultDataRef, 1,
  5282.      "(Handle dataRef, OSType dataRefType) -> None"},
  5283.     {"GetMovieDefaultDataRef", (PyCFunction)MovieObj_GetMovieDefaultDataRef, 1,
  5284.      "() -> (Handle dataRef, OSType dataRefType)"},
  5285.     {"SetMovieColorTable", (PyCFunction)MovieObj_SetMovieColorTable, 1,
  5286.      "(CTabHandle ctab) -> None"},
  5287.     {"GetMovieColorTable", (PyCFunction)MovieObj_GetMovieColorTable, 1,
  5288.      "() -> (CTabHandle ctab)"},
  5289.     {"FlattenMovie", (PyCFunction)MovieObj_FlattenMovie, 1,
  5290.      "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, Str255 resName) -> (short resId)"},
  5291.     {"FlattenMovieData", (PyCFunction)MovieObj_FlattenMovieData, 1,
  5292.      "(long movieFlattenFlags, FSSpec theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (Movie _rv)"},
  5293.     {"MovieSearchText", (PyCFunction)MovieObj_MovieSearchText, 1,
  5294.      "(Ptr text, long size, long searchFlags) -> (Track searchTrack, TimeValue searchTime, long searchOffset)"},
  5295.     {"GetPosterBox", (PyCFunction)MovieObj_GetPosterBox, 1,
  5296.      "() -> (Rect boxRect)"},
  5297.     {"SetPosterBox", (PyCFunction)MovieObj_SetPosterBox, 1,
  5298.      "(Rect boxRect) -> None"},
  5299.     {"GetMovieSegmentDisplayBoundsRgn", (PyCFunction)MovieObj_GetMovieSegmentDisplayBoundsRgn, 1,
  5300.      "(TimeValue time, TimeValue duration) -> (RgnHandle _rv)"},
  5301.     {"GetMovieStatus", (PyCFunction)MovieObj_GetMovieStatus, 1,
  5302.      "() -> (ComponentResult _rv, Track firstProblemTrack)"},
  5303.     {"NewMovieController", (PyCFunction)MovieObj_NewMovieController, 1,
  5304.      "(Rect movieRect, long someFlags) -> (MovieController _rv)"},
  5305.     {"PutMovieOnScrap", (PyCFunction)MovieObj_PutMovieOnScrap, 1,
  5306.      "(long movieScrapFlags) -> None"},
  5307.     {"SetMoviePlayHints", (PyCFunction)MovieObj_SetMoviePlayHints, 1,
  5308.      "(long flags, long flagsMask) -> None"},
  5309.     {NULL, NULL, 0}
  5310. };
  5311.  
  5312. PyMethodChain MovieObj_chain = { MovieObj_methods, NULL };
  5313.  
  5314. static PyObject *MovieObj_getattr(self, name)
  5315.     MovieObject *self;
  5316.     char *name;
  5317. {
  5318.     return Py_FindMethodInChain(&MovieObj_chain, (PyObject *)self, name);
  5319. }
  5320.  
  5321. #define MovieObj_setattr NULL
  5322.  
  5323. PyTypeObject Movie_Type = {
  5324.     PyObject_HEAD_INIT(&PyType_Type)
  5325.     0, /*ob_size*/
  5326.     "Movie", /*tp_name*/
  5327.     sizeof(MovieObject), /*tp_basicsize*/
  5328.     0, /*tp_itemsize*/
  5329.     /* methods */
  5330.     (destructor) MovieObj_dealloc, /*tp_dealloc*/
  5331.     0, /*tp_print*/
  5332.     (getattrfunc) MovieObj_getattr, /*tp_getattr*/
  5333.     (setattrfunc) MovieObj_setattr, /*tp_setattr*/
  5334. };
  5335.  
  5336. /* --------------------- End object type Movie ---------------------- */
  5337.  
  5338.  
  5339. static PyObject *Qt_EnterMovies(_self, _args)
  5340.     PyObject *_self;
  5341.     PyObject *_args;
  5342. {
  5343.     PyObject *_res = NULL;
  5344.     OSErr _err;
  5345.     if (!PyArg_ParseTuple(_args, ""))
  5346.         return NULL;
  5347.     _err = EnterMovies();
  5348.     if (_err != noErr) return PyMac_Error(_err);
  5349.     Py_INCREF(Py_None);
  5350.     _res = Py_None;
  5351.     return _res;
  5352. }
  5353.  
  5354. static PyObject *Qt_ExitMovies(_self, _args)
  5355.     PyObject *_self;
  5356.     PyObject *_args;
  5357. {
  5358.     PyObject *_res = NULL;
  5359.     if (!PyArg_ParseTuple(_args, ""))
  5360.         return NULL;
  5361.     ExitMovies();
  5362.     Py_INCREF(Py_None);
  5363.     _res = Py_None;
  5364.     return _res;
  5365. }
  5366.  
  5367. static PyObject *Qt_GetMoviesError(_self, _args)
  5368.     PyObject *_self;
  5369.     PyObject *_args;
  5370. {
  5371.     PyObject *_res = NULL;
  5372.     OSErr _err;
  5373.     if (!PyArg_ParseTuple(_args, ""))
  5374.         return NULL;
  5375.     _err = GetMoviesError();
  5376.     if (_err != noErr) return PyMac_Error(_err);
  5377.     Py_INCREF(Py_None);
  5378.     _res = Py_None;
  5379.     return _res;
  5380. }
  5381.  
  5382. static PyObject *Qt_ClearMoviesStickyError(_self, _args)
  5383.     PyObject *_self;
  5384.     PyObject *_args;
  5385. {
  5386.     PyObject *_res = NULL;
  5387.     if (!PyArg_ParseTuple(_args, ""))
  5388.         return NULL;
  5389.     ClearMoviesStickyError();
  5390.     Py_INCREF(Py_None);
  5391.     _res = Py_None;
  5392.     return _res;
  5393. }
  5394.  
  5395. static PyObject *Qt_GetMoviesStickyError(_self, _args)
  5396.     PyObject *_self;
  5397.     PyObject *_args;
  5398. {
  5399.     PyObject *_res = NULL;
  5400.     OSErr _err;
  5401.     if (!PyArg_ParseTuple(_args, ""))
  5402.         return NULL;
  5403.     _err = GetMoviesStickyError();
  5404.     if (_err != noErr) return PyMac_Error(_err);
  5405.     Py_INCREF(Py_None);
  5406.     _res = Py_None;
  5407.     return _res;
  5408. }
  5409.  
  5410. static PyObject *Qt_DisposeMatte(_self, _args)
  5411.     PyObject *_self;
  5412.     PyObject *_args;
  5413. {
  5414.     PyObject *_res = NULL;
  5415.     PixMapHandle theMatte;
  5416.     if (!PyArg_ParseTuple(_args, "O&",
  5417.                           ResObj_Convert, &theMatte))
  5418.         return NULL;
  5419.     DisposeMatte(theMatte);
  5420.     Py_INCREF(Py_None);
  5421.     _res = Py_None;
  5422.     return _res;
  5423. }
  5424.  
  5425. static PyObject *Qt_NewMovie(_self, _args)
  5426.     PyObject *_self;
  5427.     PyObject *_args;
  5428. {
  5429.     PyObject *_res = NULL;
  5430.     Movie _rv;
  5431.     long flags;
  5432.     if (!PyArg_ParseTuple(_args, "l",
  5433.                           &flags))
  5434.         return NULL;
  5435.     _rv = NewMovie(flags);
  5436.     _res = Py_BuildValue("O&",
  5437.                          MovieObj_New, _rv);
  5438.     return _res;
  5439. }
  5440.  
  5441. static PyObject *Qt_GetDataHandler(_self, _args)
  5442.     PyObject *_self;
  5443.     PyObject *_args;
  5444. {
  5445.     PyObject *_res = NULL;
  5446.     Component _rv;
  5447.     Handle dataRef;
  5448.     OSType dataHandlerSubType;
  5449.     long flags;
  5450.     if (!PyArg_ParseTuple(_args, "O&O&l",
  5451.                           ResObj_Convert, &dataRef,
  5452.                           PyMac_GetOSType, &dataHandlerSubType,
  5453.                           &flags))
  5454.         return NULL;
  5455.     _rv = GetDataHandler(dataRef,
  5456.                          dataHandlerSubType,
  5457.                          flags);
  5458.     _res = Py_BuildValue("O&",
  5459.                          CmpObj_New, _rv);
  5460.     return _res;
  5461. }
  5462.  
  5463. static PyObject *Qt_PasteHandleIntoMovie(_self, _args)
  5464.     PyObject *_self;
  5465.     PyObject *_args;
  5466. {
  5467.     PyObject *_res = NULL;
  5468.     OSErr _err;
  5469.     Handle h;
  5470.     OSType handleType;
  5471.     Movie theMovie;
  5472.     long flags;
  5473.     ComponentInstance userComp;
  5474.     if (!PyArg_ParseTuple(_args, "O&O&O&lO&",
  5475.                           ResObj_Convert, &h,
  5476.                           PyMac_GetOSType, &handleType,
  5477.                           MovieObj_Convert, &theMovie,
  5478.                           &flags,
  5479.                           CmpInstObj_Convert, &userComp))
  5480.         return NULL;
  5481.     _err = PasteHandleIntoMovie(h,
  5482.                                 handleType,
  5483.                                 theMovie,
  5484.                                 flags,
  5485.                                 userComp);
  5486.     if (_err != noErr) return PyMac_Error(_err);
  5487.     Py_INCREF(Py_None);
  5488.     _res = Py_None;
  5489.     return _res;
  5490. }
  5491.  
  5492. static PyObject *Qt_TrackTimeToMediaTime(_self, _args)
  5493.     PyObject *_self;
  5494.     PyObject *_args;
  5495. {
  5496.     PyObject *_res = NULL;
  5497.     TimeValue _rv;
  5498.     TimeValue value;
  5499.     Track theTrack;
  5500.     if (!PyArg_ParseTuple(_args, "lO&",
  5501.                           &value,
  5502.                           TrackObj_Convert, &theTrack))
  5503.         return NULL;
  5504.     _rv = TrackTimeToMediaTime(value,
  5505.                                theTrack);
  5506.     _res = Py_BuildValue("l",
  5507.                          _rv);
  5508.     return _res;
  5509. }
  5510.  
  5511. static PyObject *Qt_NewUserData(_self, _args)
  5512.     PyObject *_self;
  5513.     PyObject *_args;
  5514. {
  5515.     PyObject *_res = NULL;
  5516.     OSErr _err;
  5517.     UserData theUserData;
  5518.     if (!PyArg_ParseTuple(_args, ""))
  5519.         return NULL;
  5520.     _err = NewUserData(&theUserData);
  5521.     if (_err != noErr) return PyMac_Error(_err);
  5522.     _res = Py_BuildValue("O&",
  5523.                          UserDataObj_New, theUserData);
  5524.     return _res;
  5525. }
  5526.  
  5527. static PyObject *Qt_NewUserDataFromHandle(_self, _args)
  5528.     PyObject *_self;
  5529.     PyObject *_args;
  5530. {
  5531.     PyObject *_res = NULL;
  5532.     OSErr _err;
  5533.     Handle h;
  5534.     UserData theUserData;
  5535.     if (!PyArg_ParseTuple(_args, "O&",
  5536.                           ResObj_Convert, &h))
  5537.         return NULL;
  5538.     _err = NewUserDataFromHandle(h,
  5539.                                  &theUserData);
  5540.     if (_err != noErr) return PyMac_Error(_err);
  5541.     _res = Py_BuildValue("O&",
  5542.                          UserDataObj_New, theUserData);
  5543.     return _res;
  5544. }
  5545.  
  5546. static PyObject *Qt_CreateMovieFile(_self, _args)
  5547.     PyObject *_self;
  5548.     PyObject *_args;
  5549. {
  5550.     PyObject *_res = NULL;
  5551.     OSErr _err;
  5552.     FSSpec fileSpec;
  5553.     OSType creator;
  5554.     ScriptCode scriptTag;
  5555.     long createMovieFileFlags;
  5556.     short resRefNum;
  5557.     Movie newmovie;
  5558.     if (!PyArg_ParseTuple(_args, "O&O&hl",
  5559.                           PyMac_GetFSSpec, &fileSpec,
  5560.                           PyMac_GetOSType, &creator,
  5561.                           &scriptTag,
  5562.                           &createMovieFileFlags))
  5563.         return NULL;
  5564.     _err = CreateMovieFile(&fileSpec,
  5565.                            creator,
  5566.                            scriptTag,
  5567.                            createMovieFileFlags,
  5568.                            &resRefNum,
  5569.                            &newmovie);
  5570.     if (_err != noErr) return PyMac_Error(_err);
  5571.     _res = Py_BuildValue("hO&",
  5572.                          resRefNum,
  5573.                          MovieObj_New, newmovie);
  5574.     return _res;
  5575. }
  5576.  
  5577. static PyObject *Qt_OpenMovieFile(_self, _args)
  5578.     PyObject *_self;
  5579.     PyObject *_args;
  5580. {
  5581.     PyObject *_res = NULL;
  5582.     OSErr _err;
  5583.     FSSpec fileSpec;
  5584.     short resRefNum;
  5585.     SInt8 permission;
  5586.     if (!PyArg_ParseTuple(_args, "O&b",
  5587.                           PyMac_GetFSSpec, &fileSpec,
  5588.                           &permission))
  5589.         return NULL;
  5590.     _err = OpenMovieFile(&fileSpec,
  5591.                          &resRefNum,
  5592.                          permission);
  5593.     if (_err != noErr) return PyMac_Error(_err);
  5594.     _res = Py_BuildValue("h",
  5595.                          resRefNum);
  5596.     return _res;
  5597. }
  5598.  
  5599. static PyObject *Qt_CloseMovieFile(_self, _args)
  5600.     PyObject *_self;
  5601.     PyObject *_args;
  5602. {
  5603.     PyObject *_res = NULL;
  5604.     OSErr _err;
  5605.     short resRefNum;
  5606.     if (!PyArg_ParseTuple(_args, "h",
  5607.                           &resRefNum))
  5608.         return NULL;
  5609.     _err = CloseMovieFile(resRefNum);
  5610.     if (_err != noErr) return PyMac_Error(_err);
  5611.     Py_INCREF(Py_None);
  5612.     _res = Py_None;
  5613.     return _res;
  5614. }
  5615.  
  5616. static PyObject *Qt_DeleteMovieFile(_self, _args)
  5617.     PyObject *_self;
  5618.     PyObject *_args;
  5619. {
  5620.     PyObject *_res = NULL;
  5621.     OSErr _err;
  5622.     FSSpec fileSpec;
  5623.     if (!PyArg_ParseTuple(_args, "O&",
  5624.                           PyMac_GetFSSpec, &fileSpec))
  5625.         return NULL;
  5626.     _err = DeleteMovieFile(&fileSpec);
  5627.     if (_err != noErr) return PyMac_Error(_err);
  5628.     Py_INCREF(Py_None);
  5629.     _res = Py_None;
  5630.     return _res;
  5631. }
  5632.  
  5633. static PyObject *Qt_NewMovieFromFile(_self, _args)
  5634.     PyObject *_self;
  5635.     PyObject *_args;
  5636. {
  5637.     PyObject *_res = NULL;
  5638.     OSErr _err;
  5639.     Movie theMovie;
  5640.     short resRefNum;
  5641.     short newMovieFlags;
  5642.     Boolean dataRefWasChanged;
  5643.     if (!PyArg_ParseTuple(_args, "hh",
  5644.                           &resRefNum,
  5645.                           &newMovieFlags))
  5646.         return NULL;
  5647.     _err = NewMovieFromFile(&theMovie,
  5648.                             resRefNum,
  5649.                             (short *)0,
  5650.                             (StringPtr)0,
  5651.                             newMovieFlags,
  5652.                             &dataRefWasChanged);
  5653.     if (_err != noErr) return PyMac_Error(_err);
  5654.     _res = Py_BuildValue("O&b",
  5655.                          MovieObj_New, theMovie,
  5656.                          dataRefWasChanged);
  5657.     return _res;
  5658. }
  5659.  
  5660. static PyObject *Qt_NewMovieFromHandle(_self, _args)
  5661.     PyObject *_self;
  5662.     PyObject *_args;
  5663. {
  5664.     PyObject *_res = NULL;
  5665.     OSErr _err;
  5666.     Movie theMovie;
  5667.     Handle h;
  5668.     short newMovieFlags;
  5669.     Boolean dataRefWasChanged;
  5670.     if (!PyArg_ParseTuple(_args, "O&h",
  5671.                           ResObj_Convert, &h,
  5672.                           &newMovieFlags))
  5673.         return NULL;
  5674.     _err = NewMovieFromHandle(&theMovie,
  5675.                               h,
  5676.                               newMovieFlags,
  5677.                               &dataRefWasChanged);
  5678.     if (_err != noErr) return PyMac_Error(_err);
  5679.     _res = Py_BuildValue("O&b",
  5680.                          MovieObj_New, theMovie,
  5681.                          dataRefWasChanged);
  5682.     return _res;
  5683. }
  5684.  
  5685. static PyObject *Qt_NewMovieFromDataFork(_self, _args)
  5686.     PyObject *_self;
  5687.     PyObject *_args;
  5688. {
  5689.     PyObject *_res = NULL;
  5690.     OSErr _err;
  5691.     Movie theMovie;
  5692.     short fRefNum;
  5693.     long fileOffset;
  5694.     short newMovieFlags;
  5695.     Boolean dataRefWasChanged;
  5696.     if (!PyArg_ParseTuple(_args, "hlh",
  5697.                           &fRefNum,
  5698.                           &fileOffset,
  5699.                           &newMovieFlags))
  5700.         return NULL;
  5701.     _err = NewMovieFromDataFork(&theMovie,
  5702.                                 fRefNum,
  5703.                                 fileOffset,
  5704.                                 newMovieFlags,
  5705.                                 &dataRefWasChanged);
  5706.     if (_err != noErr) return PyMac_Error(_err);
  5707.     _res = Py_BuildValue("O&b",
  5708.                          MovieObj_New, theMovie,
  5709.                          dataRefWasChanged);
  5710.     return _res;
  5711. }
  5712.  
  5713. static PyObject *Qt_RemoveMovieResource(_self, _args)
  5714.     PyObject *_self;
  5715.     PyObject *_args;
  5716. {
  5717.     PyObject *_res = NULL;
  5718.     OSErr _err;
  5719.     short resRefNum;
  5720.     short resId;
  5721.     if (!PyArg_ParseTuple(_args, "hh",
  5722.                           &resRefNum,
  5723.                           &resId))
  5724.         return NULL;
  5725.     _err = RemoveMovieResource(resRefNum,
  5726.                                resId);
  5727.     if (_err != noErr) return PyMac_Error(_err);
  5728.     Py_INCREF(Py_None);
  5729.     _res = Py_None;
  5730.     return _res;
  5731. }
  5732.  
  5733. static PyObject *Qt_GetVideoMediaGraphicsMode(_self, _args)
  5734.     PyObject *_self;
  5735.     PyObject *_args;
  5736. {
  5737.     PyObject *_res = NULL;
  5738.     HandlerError _rv;
  5739.     MediaHandler mh;
  5740.     long graphicsMode;
  5741.     RGBColor opColor;
  5742.     if (!PyArg_ParseTuple(_args, "O&",
  5743.                           CmpInstObj_Convert, &mh))
  5744.         return NULL;
  5745.     _rv = GetVideoMediaGraphicsMode(mh,
  5746.                                     &graphicsMode,
  5747.                                     &opColor);
  5748.     _res = Py_BuildValue("llO&",
  5749.                          _rv,
  5750.                          graphicsMode,
  5751.                          QdRGB_New, &opColor);
  5752.     return _res;
  5753. }
  5754.  
  5755. static PyObject *Qt_SetVideoMediaGraphicsMode(_self, _args)
  5756.     PyObject *_self;
  5757.     PyObject *_args;
  5758. {
  5759.     PyObject *_res = NULL;
  5760.     HandlerError _rv;
  5761.     MediaHandler mh;
  5762.     long graphicsMode;
  5763.     RGBColor opColor;
  5764.     if (!PyArg_ParseTuple(_args, "O&lO&",
  5765.                           CmpInstObj_Convert, &mh,
  5766.                           &graphicsMode,
  5767.                           QdRGB_Convert, &opColor))
  5768.         return NULL;
  5769.     _rv = SetVideoMediaGraphicsMode(mh,
  5770.                                     graphicsMode,
  5771.                                     &opColor);
  5772.     _res = Py_BuildValue("l",
  5773.                          _rv);
  5774.     return _res;
  5775. }
  5776.  
  5777. static PyObject *Qt_GetSoundMediaBalance(_self, _args)
  5778.     PyObject *_self;
  5779.     PyObject *_args;
  5780. {
  5781.     PyObject *_res = NULL;
  5782.     HandlerError _rv;
  5783.     MediaHandler mh;
  5784.     short balance;
  5785.     if (!PyArg_ParseTuple(_args, "O&",
  5786.                           CmpInstObj_Convert, &mh))
  5787.         return NULL;
  5788.     _rv = GetSoundMediaBalance(mh,
  5789.                                &balance);
  5790.     _res = Py_BuildValue("lh",
  5791.                          _rv,
  5792.                          balance);
  5793.     return _res;
  5794. }
  5795.  
  5796. static PyObject *Qt_SetSoundMediaBalance(_self, _args)
  5797.     PyObject *_self;
  5798.     PyObject *_args;
  5799. {
  5800.     PyObject *_res = NULL;
  5801.     HandlerError _rv;
  5802.     MediaHandler mh;
  5803.     short balance;
  5804.     if (!PyArg_ParseTuple(_args, "O&h",
  5805.                           CmpInstObj_Convert, &mh,
  5806.                           &balance))
  5807.         return NULL;
  5808.     _rv = SetSoundMediaBalance(mh,
  5809.                                balance);
  5810.     _res = Py_BuildValue("l",
  5811.                          _rv);
  5812.     return _res;
  5813. }
  5814.  
  5815. static PyObject *Qt_FindNextText(_self, _args)
  5816.     PyObject *_self;
  5817.     PyObject *_args;
  5818. {
  5819.     PyObject *_res = NULL;
  5820.     ComponentResult _rv;
  5821.     MediaHandler mh;
  5822.     Ptr text;
  5823.     long size;
  5824.     short findFlags;
  5825.     TimeValue startTime;
  5826.     TimeValue foundTime;
  5827.     TimeValue foundDuration;
  5828.     long offset;
  5829.     if (!PyArg_ParseTuple(_args, "O&slhl",
  5830.                           CmpInstObj_Convert, &mh,
  5831.                           &text,
  5832.                           &size,
  5833.                           &findFlags,
  5834.                           &startTime))
  5835.         return NULL;
  5836.     _rv = FindNextText(mh,
  5837.                        text,
  5838.                        size,
  5839.                        findFlags,
  5840.                        startTime,
  5841.                        &foundTime,
  5842.                        &foundDuration,
  5843.                        &offset);
  5844.     _res = Py_BuildValue("llll",
  5845.                          _rv,
  5846.                          foundTime,
  5847.                          foundDuration,
  5848.                          offset);
  5849.     return _res;
  5850. }
  5851.  
  5852. static PyObject *Qt_NewMovieFromScrap(_self, _args)
  5853.     PyObject *_self;
  5854.     PyObject *_args;
  5855. {
  5856.     PyObject *_res = NULL;
  5857.     Movie _rv;
  5858.     long newMovieFlags;
  5859.     if (!PyArg_ParseTuple(_args, "l",
  5860.                           &newMovieFlags))
  5861.         return NULL;
  5862.     _rv = NewMovieFromScrap(newMovieFlags);
  5863.     _res = Py_BuildValue("O&",
  5864.                          MovieObj_New, _rv);
  5865.     return _res;
  5866. }
  5867.  
  5868. static PyObject *Qt_NewTimeBase(_self, _args)
  5869.     PyObject *_self;
  5870.     PyObject *_args;
  5871. {
  5872.     PyObject *_res = NULL;
  5873.     TimeBase _rv;
  5874.     if (!PyArg_ParseTuple(_args, ""))
  5875.         return NULL;
  5876.     _rv = NewTimeBase();
  5877.     _res = Py_BuildValue("O&",
  5878.                          TimeBaseObj_New, _rv);
  5879.     return _res;
  5880. }
  5881.  
  5882. static PyObject *Qt_AlignWindow(_self, _args)
  5883.     PyObject *_self;
  5884.     PyObject *_args;
  5885. {
  5886.     PyObject *_res = NULL;
  5887.     WindowPtr wp;
  5888.     Boolean front;
  5889.     if (!PyArg_ParseTuple(_args, "O&b",
  5890.                           WinObj_Convert, &wp,
  5891.                           &front))
  5892.         return NULL;
  5893.     AlignWindow(wp,
  5894.                 front,
  5895.                 (Rect *)0,
  5896.                 (ICMAlignmentProcRecordPtr)0);
  5897.     Py_INCREF(Py_None);
  5898.     _res = Py_None;
  5899.     return _res;
  5900. }
  5901.  
  5902. static PyObject *Qt_DragAlignedWindow(_self, _args)
  5903.     PyObject *_self;
  5904.     PyObject *_args;
  5905. {
  5906.     PyObject *_res = NULL;
  5907.     WindowPtr wp;
  5908.     Point startPt;
  5909.     Rect boundsRect;
  5910.     if (!PyArg_ParseTuple(_args, "O&O&O&",
  5911.                           WinObj_Convert, &wp,
  5912.                           PyMac_GetPoint, &startPt,
  5913.                           PyMac_GetRect, &boundsRect))
  5914.         return NULL;
  5915.     DragAlignedWindow(wp,
  5916.                       startPt,
  5917.                       &boundsRect,
  5918.                       (Rect *)0,
  5919.                       (ICMAlignmentProcRecordPtr)0);
  5920.     Py_INCREF(Py_None);
  5921.     _res = Py_None;
  5922.     return _res;
  5923. }
  5924.  
  5925. static PyMethodDef Qt_methods[] = {
  5926.     {"EnterMovies", (PyCFunction)Qt_EnterMovies, 1,
  5927.      "() -> None"},
  5928.     {"ExitMovies", (PyCFunction)Qt_ExitMovies, 1,
  5929.      "() -> None"},
  5930.     {"GetMoviesError", (PyCFunction)Qt_GetMoviesError, 1,
  5931.      "() -> None"},
  5932.     {"ClearMoviesStickyError", (PyCFunction)Qt_ClearMoviesStickyError, 1,
  5933.      "() -> None"},
  5934.     {"GetMoviesStickyError", (PyCFunction)Qt_GetMoviesStickyError, 1,
  5935.      "() -> None"},
  5936.     {"DisposeMatte", (PyCFunction)Qt_DisposeMatte, 1,
  5937.      "(PixMapHandle theMatte) -> None"},
  5938.     {"NewMovie", (PyCFunction)Qt_NewMovie, 1,
  5939.      "(long flags) -> (Movie _rv)"},
  5940.     {"GetDataHandler", (PyCFunction)Qt_GetDataHandler, 1,
  5941.      "(Handle dataRef, OSType dataHandlerSubType, long flags) -> (Component _rv)"},
  5942.     {"PasteHandleIntoMovie", (PyCFunction)Qt_PasteHandleIntoMovie, 1,
  5943.      "(Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp) -> None"},
  5944.     {"TrackTimeToMediaTime", (PyCFunction)Qt_TrackTimeToMediaTime, 1,
  5945.      "(TimeValue value, Track theTrack) -> (TimeValue _rv)"},
  5946.     {"NewUserData", (PyCFunction)Qt_NewUserData, 1,
  5947.      "() -> (UserData theUserData)"},
  5948.     {"NewUserDataFromHandle", (PyCFunction)Qt_NewUserDataFromHandle, 1,
  5949.      "(Handle h) -> (UserData theUserData)"},
  5950.     {"CreateMovieFile", (PyCFunction)Qt_CreateMovieFile, 1,
  5951.      "(FSSpec fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags) -> (short resRefNum, Movie newmovie)"},
  5952.     {"OpenMovieFile", (PyCFunction)Qt_OpenMovieFile, 1,
  5953.      "(FSSpec fileSpec, SInt8 permission) -> (short resRefNum)"},
  5954.     {"CloseMovieFile", (PyCFunction)Qt_CloseMovieFile, 1,
  5955.      "(short resRefNum) -> None"},
  5956.     {"DeleteMovieFile", (PyCFunction)Qt_DeleteMovieFile, 1,
  5957.      "(FSSpec fileSpec) -> None"},
  5958.     {"NewMovieFromFile", (PyCFunction)Qt_NewMovieFromFile, 1,
  5959.      "(short resRefNum, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
  5960.     {"NewMovieFromHandle", (PyCFunction)Qt_NewMovieFromHandle, 1,
  5961.      "(Handle h, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
  5962.     {"NewMovieFromDataFork", (PyCFunction)Qt_NewMovieFromDataFork, 1,
  5963.      "(short fRefNum, long fileOffset, short newMovieFlags) -> (Movie theMovie, Boolean dataRefWasChanged)"},
  5964.     {"RemoveMovieResource", (PyCFunction)Qt_RemoveMovieResource, 1,
  5965.      "(short resRefNum, short resId) -> None"},
  5966.     {"GetVideoMediaGraphicsMode", (PyCFunction)Qt_GetVideoMediaGraphicsMode, 1,
  5967.      "(MediaHandler mh) -> (HandlerError _rv, long graphicsMode, RGBColor opColor)"},
  5968.     {"SetVideoMediaGraphicsMode", (PyCFunction)Qt_SetVideoMediaGraphicsMode, 1,
  5969.      "(MediaHandler mh, long graphicsMode, RGBColor opColor) -> (HandlerError _rv)"},
  5970.     {"GetSoundMediaBalance", (PyCFunction)Qt_GetSoundMediaBalance, 1,
  5971.      "(MediaHandler mh) -> (HandlerError _rv, short balance)"},
  5972.     {"SetSoundMediaBalance", (PyCFunction)Qt_SetSoundMediaBalance, 1,
  5973.      "(MediaHandler mh, short balance) -> (HandlerError _rv)"},
  5974.     {"FindNextText", (PyCFunction)Qt_FindNextText, 1,
  5975.      "(MediaHandler mh, Ptr text, long size, short findFlags, TimeValue startTime) -> (ComponentResult _rv, TimeValue foundTime, TimeValue foundDuration, long offset)"},
  5976.     {"NewMovieFromScrap", (PyCFunction)Qt_NewMovieFromScrap, 1,
  5977.      "(long newMovieFlags) -> (Movie _rv)"},
  5978.     {"NewTimeBase", (PyCFunction)Qt_NewTimeBase, 1,
  5979.      "() -> (TimeBase _rv)"},
  5980.     {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1,
  5981.      "(WindowPtr wp, Boolean front) -> None"},
  5982.     {"DragAlignedWindow", (PyCFunction)Qt_DragAlignedWindow, 1,
  5983.      "(WindowPtr wp, Point startPt, Rect boundsRect) -> None"},
  5984.     {NULL, NULL, 0}
  5985. };
  5986.  
  5987.  
  5988.  
  5989.  
  5990. void initQt()
  5991. {
  5992.     PyObject *m;
  5993.     PyObject *d;
  5994.  
  5995.  
  5996.  
  5997.  
  5998.     m = Py_InitModule("Qt", Qt_methods);
  5999.     d = PyModule_GetDict(m);
  6000.     Qt_Error = PyMac_GetOSErrException();
  6001.     if (Qt_Error == NULL ||
  6002.         PyDict_SetItemString(d, "Error", Qt_Error) != 0)
  6003.         Py_FatalError("can't initialize Qt.Error");
  6004. }
  6005.  
  6006. /* ========================= End module Qt ========================== */
  6007.  
  6008.